Order of Execution in Salesforce

When we save a record with an insert update, or upsert statement salesforce performs the events in order because when the event happens, Order of Execution is very important because they are multiple things tied to a single event and when the event gets fired we need to know which processes are running first and which processes are running last.

Inclined to build a profession as SalesForce Developer? Then here is the blog post on, explore SalesForce Training

The order of execution is in the following order.

  • Executes all before triggers.
  • System validations are performed.
  • Custom validations are performed.
  • Saves the record but does not commit
  • Executes all after triggers.
  • Executes assignment rules
  • Executes auto-response rules
  • Executes workflow rules
  • If the record was updated with workflow field updates, fires before and after triggers are more time in addition to standard validations. Custom validation rules are not run again.
  • Executes escalation rules
  • Commits to the database

For in-depth understanding on Salesforce click on