Client: (First executed)
1. Perform javascript validation.
Server:
1. Loading data from the database for Upsert statements
2. Load new data from the client and overwrite the historical data
Standard SF page data: For system Validation, including:
A. Compliance with the rules of the page layout (different page layouts show different fields)
B. Required for page/field level
C. Whether the completed data is a valid format
D. Length limitation of the data entered
E. User-defined limits
Apex Application/soap Call: The system Validation is not performed directly to the user's own defined limits.
3. Before logic for executing trigger
4. Execute the system Validation,customer Validation again
5. Duplicate Data rules:
6. Save data to DB, but no commit.
7. After logic to execute trigger
8. Execution assignment rule (owner's distribution rules)
9. Execute SF auto Response (SF Auto response rule)
10. Enforcement of workflow rules
11. If Workflow has field update (field updates), update the historical data again
12. Perform trigger before update and after update logic (only once), and System validation will execute. Customer Validation and Duplicate rule are no longer executed.
13. Executive Processes
14. Implementation of escalation Rule
15. Implementation of Entitlement Rule
16. Update the value of the Roll up field on the parent object in Master-detail. Also, perform cross-object workflow
17. If the parent object is a detail object in Master-detail, continue executing the value of the Roll up field on its parent object,
18. Executive Criteria Based Sharing evaluation (standard data sharing rules)
19. Commit DML operations to DB
20. Perform other actions, such as sending e-mails, etc.
Reference Document: Https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers_order_of_execution.htm
sf-Execution Order