in Salesforce by
Q:
What is the Bulkification best practice?

1 Answer

0 votes
by
We must avoid using index values like Trigger.New[0] as we never know how many records we get in Trigger.New at runtime.

We need to use for each loop whether we have 1 record or many.

We must not use SOQL inside for loop.

We must not use SOSL inside for loop.

We must not use DML inside for loop.

We need to store data in collections, so our code will work for single as well as multiple records.
Click here to read more about Salesforce
Click here to read more about Insurance

Related questions

0 votes
asked Sep 24, 2019 in Salesforce by Robin
0 votes
asked Sep 26, 2019 in Salesforce by Robin
0 votes
asked Sep 24, 2019 in Salesforce by Robin
0 votes
asked Sep 26, 2019 in Salesforce by Robin
0 votes
0 votes
asked May 11, 2020 in Testing by SakshiSharma
0 votes
asked Sep 24, 2019 in Salesforce by Robin
...