Skip to content

Instantly share code, notes, and snippets.

View shawon39's full-sized avatar
🎯
Focusing

Shakhawat Hossain shawon39

🎯
Focusing
View GitHub Profile
@shawon39
shawon39 / Salesforce Object CRUD permission check
Created May 24, 2023 06:09
The provided code snippets are used to check the user's access permissions on the Contact object in Salesforce. The isAccessible() method verifies if the user can read Contact records, isUpdateable() checks if the user can update them, isCreateable() determines if the user can create new Contact records, and isDeletable() confirms if the user ha…
System.debug('Accessible: ' + Schema.sObjectType.Contact.isAccessible());
System.debug('Updateable: ' + Schema.sObjectType.Contact.isUpdateable());
System.debug('Createable: ' + Schema.sObjectType.Contact.isCreateable());
System.debug('Deletable: ' + Contact.sObjectType.getDescribe().isDeletable());
sfdx Your_Command
sfdx force:doc:commands:list
Command Description
==================================================================================
alias:list list username aliases for the Salesforce CLI
alias:set set username aliases for the Salesforce CLI
alias:unset unsets aliases for the Salesforce CLI
auth:device:login authorize an org using a device code
auth:jwt:grant authorize an org using the JWT flow
@shawon39
shawon39 / Triggers.apxt
Created December 20, 2020 14:25
Apex Triggers
trigger DmlTriggerBulk on Account(after update) {
List<Opportunity> relatedOpps = [SELECT Id,Name,Probability FROM
Opportunity WHERE AccountId IN :Trigger.New];
List<Opportunity> oppsToUpdate = new List<Opportunity>();
for(Opportunity opp : relatedOpps) {
if ((opp.Probability >= 50) && (opp.Probability < 100)) {
opp.Description = 'New description for opportunity.';
oppsToUpdate.add(opp);