Salesforce Order of Execution

 

The order of execution in Salesforce is a sequence of steps that occur when a record is saved. Understanding this order is crucial for developers and administrators to ensure that customizations and automations work as expected. Here is the order of execution in Salesforce:

1.     System Validation Rules: Salesforce performs system validations to check for required fields, data types, and field formats.

2.     Before Triggers: Executes before any record is saved to the database.

3.     Custom Validation Rules: Executes custom validation rules defined by administrators.

4.     Duplicate Rules: Executes duplicate rules to check for duplicate records.

5.     After Triggers: Executes after the record is saved to the database.

6.     Assignment Rules: Executes assignment rules, such as lead assignment rules.

7.     Auto-Response Rules: Executes auto-response rules, such as sending automatic email responses.

8.     Workflow Rules: Executes workflow rules and updates the record if necessary.

9.     Processes: Executes processes created in Process Builder.

10.  Escalation Rules: Executes escalation rules, such as case escalation rules.

11.  Entitlement Rules: Executes entitlement rules for cases.

12.  Roll-Up Summary Fields: Updates roll-up summary fields if the record is part of a master-detail relationship.

13.  Parent Roll-Up Summary Fields: Updates roll-up summary fields on parent records.

14.  Criteria-Based Sharing Rules: Evaluates criteria-based sharing rules.

15.  Commit: Commits the record to the database.

16.  Post-Commit Logic: Executes post-commit logic, such as sending email notifications.

This order ensures that all necessary validations, triggers, and automations are executed in a logical sequence, maintaining data integrity and consistency.

Feel free to post any comments regarding mistakes, corrections, ideas, and suggestions related to the article.

Thank you for reading the article.

Jayanth A

Comments

Popular posts from this blog

Salesforce Admin Notes

Salesforce Limitations