Skip to content

Instantly share code, notes, and snippets.

View mhamzas's full-sized avatar

Hamza Siddiqui mhamzas

View GitHub Profile
@mhamzas
mhamzas / GetFirstFromCollection.cls
Last active June 18, 2020 11:31
Build Invocable Actions That Work for Multiple Objects
public with sharing class GetFirstFromCollection {
@InvocableMethod
public static List <Results> execute (List<Requests> requestList) {
List<SObject> inputCollection = requestList[0].inputCollection;
SObject outputMember = inputCollection[0];
//Create a Results object to hold the return values
<!--
@File Name : lightningInput.html
@Description :
@Author : M Hamza Siddiqui @ mhamzas.com
@Group :
@Last Modified By : M Hamza Siddiqui @ mhamzas.com
@Last Modified On : 6/23/2020, 9:37:07 PM
@Modification Log :
Ver Date Author Modification
1.0 6/21/2020 M Hamza Siddiqui @ mhamzas.com Initial Version
<template>
<div class="slds-grid slds-wrap">
<div class="slds-col slds-size_1-of-2">
<span>
<lightning-card title="What do you want to Watch?">
<img
src="https://s.studiobinder.com/wp-content/uploads/2019/06/Best-M-Night-Shyamalan-Movies-and-Directing-Style-StudioBinder.jpg" />
<p class="slds-p-horizontal_small"></p>
<div class="Search">
<lightning-input value={movieStr} onchange={moviename} label="Search Online Database" placeholder="Movie or Series Name....">
@mhamzas
mhamzas / ApexFileUpload.cls
Created July 2, 2020 12:40 — forked from aptkdev/ApexFileUpload.cls
Apex File File Upload (Using ContentVersion)
/*
* @class FileUploaderClass
* @desc Lets you uplaod a file in Salesforce by giving a base64 string of the
* file, a name for the file, and the Id of the record that you want to attach
* the file to.
*
* @example:
* FileUploaderClass.uploadFile(myBase64String, 'Invoice.pdf', '906F0000000kG2UIAU')
*/
public class FileUploaderClass {
@mhamzas
mhamzas / AddtoCalender.cmp
Created July 6, 2020 19:24
ADDEVENT - Add to Calendar Button for Flow Screen - Lightning Component [AURA]
<aura:component implements="lightning:availableForFlowScreens" access="global" >
<aura:attribute name="showBtn" type="Boolean" default="false" />
<aura:attribute name="start" type="String" default="07/20/2020 08:00 AM" />
<aura:attribute name="end" type="String" default="07/20/2020 10:00 AM" />
<aura:attribute name="timezone" type="String" default="America/Los_Angeles" />
<aura:attribute name="title" type="String" default="Summary of the event" />
<aura:attribute name="description" type="String" default="Description of the event" />
<aura:attribute name="location" type="String" default="Location of the event" />
@mhamzas
mhamzas / test.html
Created July 8, 2020 14:13
Toggle Class (Simple Approach)
<template>
<button class={cssClass} onclick={handleToggleClick}>
<lightning-icon icon-name={iconName}></lightning-icon>
Non Profit
</button>
</template>
@mhamzas
mhamzas / test.css
Created July 8, 2020 14:15
Toggle Class (classList Approach)
/*to show the image*/
.SelectedBorderOrgType .markIcon {
display: block;
}
/*to hide the image*/
.NonSelectedBorderOrgType .markIcon {
display: none;
}
.SelectedBorderOrgType .pillLabel1 {
font-weight: 600;
@mhamzas
mhamzas / index.html
Created July 11, 2020 23:43 — forked from jrue/index.html
HTML & CSS Wheel Of Fortune / Bingo Game
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Wheel of Fortune Bingo</title>
<!--
MIT License
@mhamzas
mhamzas / BatchGrantPermissionSet.cls
Created October 6, 2020 10:53 — forked from gbutt/BatchGrantPermissionSet.cls
Grant Permission Set or Permission Set Group to Users in Batch Apex
/**
* Assigns a permission set or permission set group to all user with the specified profile.
* Additional filter criteria can be passed in if the users needs filtered further.
* Example: Only assign permission set to community users on the Salesforce account
* String filter = 'Contact.Account.Name = \'Salesforce\'';
* BatchGrantPermissionSet('Community User Profile', 'Salesforce_Account_Privs', filter);
*/
public class BatchGrantPermissionSet implements Database.Batchable<sObject> {
String query {get; set;}
@mhamzas
mhamzas / Metadata_to_GIT.bat
Created November 9, 2020 10:40
This Batch file will get metadata from your Salesforce ORG and push it to GIT
@ECHO OFF
:: This batch file fetches metadata from your Salesforce ORG and push it to GIT.
:: Pre-Requsitie : Install : Node & https://www.npmjs.com/package/cs-jsforce-metadata-tools
:: npm install jsforce-metadata-tools -g
TITLE Salesforce Metadata to GIT
ECHO Welcome ! This Batch file will get metadata from your Salesforce ORG and push it to GIT
ECHO ============================
ECHO AUTHOR : M Hamza Siddiqui
ECHO WEBSITE : www.mhamzas.com
ECHO CONTACT : contact@mhamzas.com