Interview Question
Qus: What is the order of execution in salesforce?
Answers (1)
If the condition is same for all the rules which will execute first and which will execute next, for this salesforce provide the order.
Order of execution in sales force
Prepare the record for insert/update operation.
It will replace all the old field values with new field values.
If the request is coming form UI all the system validations will execute –
DataType
Length
Required
Unique
PageLayout level validations
Before triggers
Custom Validations and again system validation rules will fire (Page Layout level validations won’t fire at this point of time)
Record will be saved into the database but doesn’t not commit.
After triggers
Assignment rules
Auto-responsive rules
Workflow Rules
In case of Workflow Rule Field updates again before triggers and after triggers fire one more time
System validation rules for duplicate check
Escalation Rules
Rollup-Summary fields will be calculated
Grant parent Rollup-Summary fields will be calculated
Criteria base sharing evaluation
Record will be committed into the database
Post commits logic (Sending emails)