Monday 15 May 2017

Trigger Order of Execution

  1. System Validation rule (required field, field format) (SV)
  2. Before Triggers are executed (BT)
  3. Custom Validation rules are checked (CV)
  4. After Triggers are executed (AT)
  5. Assignment Rules are executed (AR)
  6. Auto-Response Rules are executed (ARR)
  7. Workflow Rules are executed (WR)
    1. Before and after triggers are executed one more time if the workflow rule updates a field (BT & AT)
  8. Escalation Rules are executed (ER)
  9. Parent Rollup Summary Formula or Cross Object Formula fields are updated in the respective objects. (RSF, COF) (These parent records also goes through the entire execution order)
  10. Criteria Based Sharing rules are evaluated (CBS)
  11. Any Post-Commit Logic is executed (PCL)  (like sending an email)
To remember this sequence you can memorise the following.
SV -> BT -> CV -> AT -> AR -> ARR -> WR (BT, AT) -> ER -> RSFCOF -> CBS -> PCL

No comments:

Post a Comment

Batch Apex

1. What are transaction limits in apex? Total number of SOQL queries issued1 - 100 Total number of records retrieved by SOQL queries - 50...