Thursday, November 1, 2018

What is order of execution in Salesforce?

Today we will try to cover the topic order of execution in Salesforce.

When we save a record , the following is the order of execution in Salesforce,

order of execution in salesforce


1)System validation to verify all required fields are supplied.


2)All before trigger.


3)System validation again to verify all required fields are supplied.


4)The record is saved but not committed to the database.


5)All after trigger.


6)Assignment rules.


7)Auto response rule.


8)Workflow rules.


If field update occurs through workflow than,



9)Before trigger once again.


10)After trigger once again.


11)escalation rules.


12)Commit dml to database.


NOTE:

  • To avoid running of trigger multiple times (i.e to avoid recursive trigger) we can make use of static variable.
  • Order of execution is not guaranteed in case of multiple triggers on same object.

**************************************************************************************************************
TAGS:order of execution in Salesforce,order of execution in Salesforce interview questions,What is order of execution in Salesforce?

**************************************************************************************************************

No comments:

Post a Comment