Best Explained: Salesforce Order Of Execution

Hello, Friends, I am very happy to tell you all with this useful information. This post is only for Beginners. And for the experienced persons, this post helps them to refresh the things which they already know.

So, Friends, I am here to share about Order of Execution in Salesforce. When we Create/Update/Insert/Delete a record, so many actions will take part of it. Below I will list out the executions in order.

NOTE: Before Salesforce executes these events on its server, the browser runs JavaScript validation. If the record contains any dependent picklist fields. The validation limits each dependent picklist field to its available values. No other validation occurs on the client side.

1) Firstly Salesforce Loads the original record from the database or initializes the record for an upsert statement.

2) Loads the new record field values and overwrite the old values.

3) If you are using Standard UI, Standard validations will take part now.

For instance – Valid field format, Maximum length of the field and etc…

4) Executes all Before triggers.

5) Executes all Custom validations.

6) Executes Duplicate Rules.

7) Salesforce Saves the record to the database. But it doesn’t commit yet.

8) Executes all After trigger.

9) Executes Assignment Rules.

10) Executes Auto-Response Rules.

11) Executes our favorite Workflow Rules.

12) If there are any workflow updates, update the record again.

13) The records which are updated with workflow, field updates, fires before update triggers and after update trigger one more time (only one more time), in addition to standard validations. Custom validation rules and duplicate rules are not run again.

14) Executes Processes.

15) Executes Escalation Rules.

16) Executes Entitlement Rules.

17) If the record contains a roll-up summary field or is part of a cross-object workflow, performs calculations and updates the roll-up summary field in the parent record.

18) If the parent record is updated, and a grandparent record contains a roll-up summary field or is part of a cross-object workflow, performs calculations and updates the roll-up summary field in the grandparent record.

19) Executes Criteria Based Sharing evaluation.

20) Commits all DML operations to the database.

21) Executes post-commit logic. For instances – Sending.

Stay tuned to for more updates.

Thank you so much for reading my post. Feel free to ask doubts/Queries in the comment section below, and I’ll come again with an interesting topic about Salesforce So Please Share, Subscribe to our blog for the latest update.

Leave a Reply