The following is the order salesforce logic is applied to a record.
- Old record loaded from database (or initialized for new inserts)
- New record values overwrite old values
- System Validation Rules
- All Apex before triggers (EE / UE only)
- Custom Validation Rules
- Record saved to database (but not committed)
- Record reloaded from database
- All Apex after triggers (EE / UE only)
- Assignment rules
- Auto-response rules
- Workflow rules
- Escalation rules
- Parent Rollup Summary Formula value updated (if present)
- Database commit
- Post-commit logic (sending email)
Additional notes:
There is no way to control the order of execution within each group above.
Workflow field updates that run based on an approval process or time-dependent action do not trigger any rules.
Formula fields do not execute in this way. They calculate and display their results real-time whenever the field is accessed in any way. So for example if a Workflow Rule uses a Formula Field in its criteria or formula, the formula field is evaluated when the Workflow Rule criteria is checked.