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
| function findValues(obj, key){ | |
| return findValuesHelper(obj, key, []); | |
| } | |
| function findValuesHelper(obj, key, list) { | |
| if (!obj) return list; | |
| if (obj instanceof Array) { | |
| for (var i in obj) { | |
| list = list.concat(findValuesHelper(obj[i], key, [])); | |
| } |
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 UpdateFieldAction { | |
| @InvocableMethod( | |
| label='Update Field Action' | |
| description = 'Update a field on another object' | |
| ) | |
| public static void updateFields(List<Request> requests) { | |
| for(Request request : requests){ | |
| updateField(request); |
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
| <apex:page standardController="Account"> | |
| <!-- classic attachments related list --> | |
| <apex:relatedList subject="{!account.id}" list="CombinedAttachments" /> | |
| <!-- new salesforce files related list --> | |
| <apex:relatedList subject="{!account.id}" list="AttachedContentDocuments" /> | |
| </apex:page> |
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
| @echo off | |
| TITLE Data Migrate for FSC | |
| ECHO this batch file will Migrate the data from 1 org to another (FSC). Press any key to continue | |
| PAUSE | |
| set /p sourceOrgAlias="Enter Source Org Alias (Example: ABCScratch): " | |
| set /p targetOrgAlias="Enter Target Org Alias (Example: XYZScratch): " | |
| set /p jsonpath="Enter export.json Path (Example: C:\Users\USER\Documents\SFDMU_APP\data\Default): " | |
| sfdx sfdmu:run --sourceusername %sourceOrgAlias% --targetusername %targetOrgAlias% -p %jsonpath% |
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 with sharing class InvocableApexTemplate { | |
| @InvocableMethod( | |
| label = 'Name as displayed in Process Builder' | |
| description = 'Tooltip as displayed in Process Builder' | |
| ) | |
| public static List<Response> execute( List<Request> requests ) { | |
| List<Response> responses = new List<Response>(); | |
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 static void getLabelsfromAPINames(String ObjectApi, String FieldApi){ | |
| if(!String.IsBlank(ObjectApi) && !String.IsBlank(FieldApi)){ | |
| system.debug('Object : '+(String)Schema.getGlobalDescribe().get(ObjectApi).getDescribe().getLabel()+', Field : '+ (String)Schema.getGlobalDescribe().get(ObjectApi).getDescribe().fields.getMap().get(FieldApi).getDescribe().getLabel()+' \n'; | |
| } | |
| } | |
| // Usage | |
| getLabelsfromAPINames('Account', 'Name'); |
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 objName = 'Account'; | |
| String recordName = 'Salesforce'; | |
| sObject sObj = Schema.getGlobalDescribe().get(objName).newSObject(); | |
| sObj.put('Name', recordName) ; | |
| Insert sObj ; |
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
| /*------------Accessing parent field values in child to parent dynamic query----// | |
| //Below is static method which can be used to fetch field values.// | |
| //You need to pass sObject and fieldAPIName to get field value---*/ | |
| // CREDITS: https://www.sfdcstuff.com/2019/06/accessing-parent-field-values-from.html | |
| public static string ExtractFieldValues(sObject sb, string fieldAPIName) { | |
| string fvalue = ''; | |
| if (fieldAPIName.contains('.')) { | |
| List < string > splitedFields = fieldAPIName.split('\\.'); | |
| try { |
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
| /** | |
| * Used to read a delimited file. | |
| */ | |
| public class SSSCsvReader { | |
| private String delim = ','; | |
| // the input data | |
| private String[] buffer; | |
| public SSSCsvReader(String data){ | |
| this.buffer = data.split('\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
| <?xml version="1.0" encoding="UTF-8" ?> | |
| <Package xmlns="http://soap.sforce.com/2006/04/metadata"> | |
| <types> | |
| <members>*</members> | |
| <name>ApexClass</name> | |
| </types> | |
| <types> | |
| <members>*</members> | |
| <name>ApexComponent</name> | |
| </types> |