This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IF(ISBLANK(ParentId), Id, | |
IF( | |
/* Parent Level 10 */ | |
NOT(ISBLANK(Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.ParentId)) | |
,Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Id | |
,IF( | |
/* Parent Level 9 */ | |
NOT(ISBLANK(Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.ParentId)) | |
,Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Id | |
,IF( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string sourceOrgDomainURL = 'https://xxxxzzzxxxxx.salesforce.com'; | |
string sourceOrgSessionId = UserInfo.getSessionID(); //specify source org sessionid URL | |
string targetOrgDomainURL = 'https://xxxvvvvvxxxxx.salesforce.com'; | |
//specify target org sessionid or access_token | |
string targetOrgSessionId ='00DxxxxxxxxxxxxxxxxxxxxeeeeeeeeeeeeezzzzzzzxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxbMD7q__aWFV3XmO3CNLdyqsY'; | |
string profileName = 'System Administrator'; | |
profileName = profileName.replaceAll(' ','+'); | |
//First fetch CRUD permission for profile from Source Org | |
string sourceEndPointURL = sourceOrgDomainURL+'/services/data/v48.0/query/?q=SELECT+Id,ParentId,SobjectType,PermissionsCreate,PermissionsRead,PermissionsEdit,PermissionsDelete,PermissionsViewAllRecords,PermissionsModifyAllRecords+FROM+ObjectPermissions+WHERE+ParentId+IN+(SELECT+PermissionSetId+FROM+PermissionSetAssignment+WHERE+PermissionSet.Profile.Name=\''+profileName+'\')+ORDER+BY+SobjectType'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<aura:application extends="force:slds"> | |
<c:SK_PromiseAllDemo/> | |
</aura:application> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Author: Sunil Kumar | |
Purpose: To get file content from BOX | |
*/ | |
public class SK_BoxAPIUtilityClass { | |
//method to get file details from box | |
public static string findFileNameFromBox(string boxFileId,string access_token){ | |
string filename=''; | |
string endPointUrl='https://api.box.com/2.0/files/'+boxFileId; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<aura:component controller="SK_PromisePatternDemoController"> | |
<aura:attribute name="ltngAccList" type="List"/> | |
<aura:attribute name="ltngTaskList" type="List"/> | |
<aura:attribute name="ltngClickedAction" type="String" default=""/> | |
<aura:attribute name="ltngAccInfoString" type="String" default=""/> | |
<aura:attribute name="ltngTaskInfoString" type="String" default=""/> | |
<lightning:button label="Fetch 2 records using callback pattern" onclick="{!c.findDataUsingNormalCall}"/> | |
<lightning:button label="Fetch 3 records using promise pattern" onclick="{!c.findDataUsingPromise}"/> | |
<br/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// =========================================================================== | |
// Entity: SK_EmailAlertJSONParser | |
// Author: Sunil Kumar | |
// Purpose: wrapper class to parse emailalert response JSON using tooling api | |
// '/services/data/v47.0/tooling/sobjects/WorkflowAlert/01W380000xxxxbs' | |
// =========================================================================== | |
public class SK_EmailAlertJSONParser { | |
public string Id; | |
public String CcEmails ; | |
public String Description ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string LibraryName='Demo Download Library'; | |
ContentWorkspace ws = [SELECT Id, RootContentFolderId FROM ContentWorkspace WHERE Name = :LibraryName LIMIT 1]; | |
Set<string> fileNameList = new Set<string>(); | |
List<ContentDocumentLink> filesToDelete= new List<ContentDocumentLink>(); | |
string csvString=''; | |
String domainUrl=URL.getSalesforceBaseUrl().toExternalForm(); | |
for(ContentDocumentLink con:[select id,LinkedEntityId,ContentDocumentId ,ContentDocument.LatestPublishedVersion.Title from ContentDocumentLink where LinkedEntityId=:ws.Id]){ | |
csvString = csvString +domainUrl+'/sfc/servlet.shepherd/version/download/'+con.ContentDocument.LatestPublishedVersionId+'\n'; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SK_ConvertNotesForLightningBatch implements Database.Batchable<sObject>,Database.Stateful{ | |
public string qString; | |
string errorDetailsString = 'Parent Record Id ,Note Id, Error deatils \n'; | |
string successRecordString='Parent Record Id ,Note Id,ContentNote Id \n'; | |
long jobStartTime= 0; | |
long jobEndTime= 0; | |
public SK_ConvertNotesForLightningBatch(string qStr){ | |
qString = qStr; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<aura:component implements="force:appHostable,flexipage:availableForRecordHome,force:hasRecordId" > | |
<lightning:button name="Create Quick Contact" label="Create Quick Contact" onclick="{!c.createQuickContact}"/> | |
</aura:component> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SK_ConvertAttachmentsToFilesBatch implements Database.Batchable<sObject>,Database.Stateful{ | |
public string qString; | |
string errorDetailsString = 'Parent Record Id ,Attachment Id, Error deatils \n'; | |
string successRecordString='Parent Record Id ,Attachment Id,ContentVersionId \n'; | |
long jobStartTime= 0; | |
long jobEndTime= 0; | |
public SK_ConvertAttachmentsToFilesBatch(string qStr){ | |
qString = qStr; | |
} |