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”Tag: Apex class
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”LWC: Custom picklist using lightning-combobox
When working with LWC sometimes, you need a list of values in picklist(combobox) which is fetched from an apex class. Values can be based on some condition. So, in this blog, we will see how to fetch a list of sObject records and bind values into <lightning-combobox />.
Continue reading “LWC: Custom picklist using lightning-combobox”Using Limit class in Salesforce
We know that salesforce works on the concept of Multi-Tenancy, because of which there are many governor limits that are in place to use the salesforce server resources smoothly. To check the limitations of in apex class as per specific scenario, we can make use of standard limit class.
The Limits methods return the specific limit for the particular governor, such as
- the number of calls of a method
- the amount of heap size remaining.
- Query Limits
- Queueable Jobs
- Number of API calls
- Limits on DML statements
Security.stripInaccessible
When working on DML operation in salesforce from Apex class developer might miss the security permissions that are assigned to different users through profiles, permission sets, sharing rules etc. This can lead to an exception. In this blog we will just see the solution for trailhead module for PD-1 certification. I will cover more details about stripInaccessible feature in a separate blog.
Continue reading “Security.stripInaccessible”