Order of execution In Salesforce
In Salesforce, the order of execution is the order in which the system processes various events and actions. It's important to understand the order of execution in Salesforce because it determines the order in which certain events occur, and can affect how your code behaves. Here is a summary of the order of execution in Salesforce:
- Loads the original record from the database or initializes the record for an insert operation.
- Executes all before triggers.
- Validates the record to ensure that it meets all validation rules.
- Executes all after triggers.
- Saves the record to the database, but doesn't commit yet.
- Executes assignment rules.
- Executes auto-response rules.
- If there are workflow field updates, updates the record again.
- If the record was updated with workflow field updates, fires before and after update triggers one more time (and only one more time), in addition to standard validations.
- Commits the record to the database.
- Executes post-commit logic, such as sending email.
No comments:
Post a Comment