Order of Execution in Salesforce

  • Loads the original record from DB.
  • Loads the new record field values and overwrite the old values.
  • If you are using Standard UI, system validation rules will be execute.
  • Executes all before triggers.
  • Executes all user defined validation rules.
  • Saves the record to the database, but does not commit yet.
  • Executes all After trigger.
  • Executes Assignment Rules.
  • Executes Auto-Response Rules.
  • Executes Workflow Rules.
  • If there are any workflow updates, update the record again.
  • If the record was updated with workflow field updates, fires before update triggers and after update triggers one more time, in addition to standard validations. Custom validation rules and duplicate rules are not run again.
  • Executes Processes.
  • Executes Escalation Rules.
  • Executes Entitlement Rules.
  • If the record contains a roll-up summary field or is part of a cross-object workflow, performs calculations and updates the roll-up summary field in the parent record.
  • If the parent record is updated, and a grandparent record contains a roll-up summary field or is part of a cross-object workflow, performs calculations and updates the roll-up summary field in the grandparent record.
  • Executes Criteria Based Sharing evaluation.
  • Commits all DML operations.
  • Executes post-commit logic, like sending emails.
Order of Execution in Salesforce

Order of Execution in Salesforce