Salesforce Basic

APEX: SOQL to MAP of sObject

Usually in trigger, we work on updating related lists we end up querying sObject and looping over it. Or we also make a MAP from that list of records which will create lots of loops and iterations. To avoid this. Salesforce provide us with a simple feature where you can write a SOQL query and return MAP directly.

Continue reading “APEX: SOQL to MAP of sObject”
Salesforce Basic

APEX: How to check if ORG is Sandbox or Production

Recently after a major deployment, we took refresh of a sandbox org. One of the developers worked on a change request on the refreshed copy. Unfortunately, he forgot to change Named Credentials, Auth Provider, Remote site setting. After working on the change request, developer started testing the same. This resulted in record creation in third party application through API’s. There were many test records which were created in third party applications and the issue got escalated.

Continue reading “APEX: How to check if ORG is Sandbox or Production”
Uncategorized

sObject Name from RecordId in Apex Class

When working on visualforce pages, there will be a requirement to get to know the sObject name of a record on which you are working. In lightning experience, you will get to know to know the sObject directly just like recordId. But such option is not available in classic version’s visualforce pages.

Continue reading “sObject Name from RecordId in Apex Class”
Salesforce Basic · Security Model

Access Modifiers in Salesforce

Access modifiers are used in apex class in salesforce. Similar to Java programming, Salesforce supports 4 different access modifiers in salesforce.

  1. private
  2. protected
  3. public
  4. global
Continue reading “Access Modifiers in Salesforce”