Salesforce Order Of Execution

There's quite a lot of options when it comes to implementing business logic in Salesforce. When pressing the "Save" button each of these options is triggered in a specific order that is important to know and remember.
In most cases, you wouldn't know the difference. But when you start using several business logic components on the same object it all becomes relevant. Take for example a Case object configured with Escalation Rules, adding a set of Validation Rules and again one or several Workflow Rules may lead to unexpected behaviours. Unless you master the Order Of Execution...

Below is the simplified sequence:

  1. 😈 System validation rules
  2. ⏪ Apex before triggers
  3. ✔️ Custom validation rules
  4. ⏩ Apex after triggers
  5. 👨👩 Assignment rules
  6. ♻️ Auto-response rules
  7. 🚀 Workflow rules
  8. 🍄 Process
  9. 📟 Escalation rules
  10. 🔎 Roll-up summary fields

Related Posts & Resources

I hope you enjoyed this post. Don't hesitate to ping me on Twitter if you have any comment or question.

Fab 🐸