Order of execution
Order of execution is one of the single most important concepts in Salesforce as a whole. From what we have learned about TDTM and how it helps configure the order of execution for triggers, you should have a better understanding of how important the order of execution is. Triggers are only one part of the larger puzzle. You may want to familiarize yourself with the order that things happen and when they happen.
The list is long, and the considerations are many. At a high level, here is what the order of execution looks like when you save a record:
- Loads the original record from the database or initializes the record for an upsert statement.
- Loads the new record field values from the request and overwrites the old values.
- Executes record-triggered flows that are configured to run before the record is saved.
- Executes all previous triggers.
- Runs most system validation steps again, such as verifying that all required fields. have a non-null...