On links below you can check the many ways to retrieve and deploy Salesforce metadata.
This file contains 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 isEmptyParam(param) { | |
if (param || param.length > 0) | |
return false; | |
else | |
return true; | |
} | |
function verifyMinCaracteres(min, str) { | |
if (str.length >= min) | |
return true; |
This file contains 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 UpdateNoOfOpenTask { | |
public static void updateNoOfTasks(List<Task> newTasks) { | |
//WhoId holds the Lead or Contact Id | |
Set<Id> contactIds = new Set<Id>(); | |
for(Task t : newTasks) { | |
if(t.WhoId != null && String.valueOf(t.WhoId).startsWith('003')) { |
This file contains 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
//get RecordTypeId by Developer Name | |
Id theRecordTypeId = Schema.SObjectType.Case.getRecordTypeInfosByDeveloperName().get('My_RecordType_Developer_Name').getRecordTypeId(); | |
//get RecordTypeId by Name | |
Id theRecordTypeId = Schema.SObjectType.Account.getRecordTypeInfosByName().get('Record Type Name').getRecordTypeId(); | |
//get RecordType Name by Id | |
String theRecordTypeName = Schema.SObjectType.Account.getRecordTypeInfosById().get('RecordTypeId').getname(); | |
//where the 'RecordTypeId' is the Id |
This file contains 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
//Option 1 | |
String myRandomString = EncodingUtil.convertToHex(Crypto.generateAesKey(128)).substring(0, 32) | |
//Option 2 | |
Integer len = 32; | |
Blob blobKey = crypto.generateAesKey(192); | |
String key = EncodingUtil.base64encode(blobKey); | |
String myRandomString = key.substring(0,len); | |
//Option 2.1 |