Mt Lindsay

Tuesday, January 15, 2019

Mnemonic for Salesforce Save Order of Execution

I came up with this mnemonic while studying for the Salesforce Platform Developer 1 Exam.

The steps are grouped together and based on this document.

Salesforce Apex Developer Guide- Triggers and Order of Execution

Below are the groups, and the corresponding mnemonic.

L - Load (Record is loaded or initialized/field values loaded into SObject)
V - Validation (System validation rules)
T - Triggers (Before triggers executed)
Lion Visits Tiger

V - Validation (System and custom validation rules)
D - Duplicates (Execute duplicate rules)
T - Triggers (After triggers executed (record is first saved, not committed to db))
Voicing Displeasure to Tiger

AS - Assignment (Execution of assignment rules)
AUTO - Auto-response (Execution of auto-response rules)
WF - Workflow rules (Execution of workflow rules (field update executes triggers)
ASsuming AUTOmatically they Would Fight

P - Processes (Execution of process builders and flows)
ESC - Escalation (Execution of escalation rules)
ENT - Entitlement (Execution of entitlement rules)
R - Rollup (Rollup summary fields updated) 
F - Formula (Cross-object formula fields are updated)
he Pounced, ESCalating the ENTanglement, Removing Fur

P - Parent (Parent and grandparent records are saved)
S - Sharing (Criteria-based sharing rules are evaluated)
C - Commit (DML operations committed to db)
P - Post-commit (Post-commit logic)
the Pride Shared the Conquest, Party on!

Hope you find it helpful!
Thanks, Tom

9 comments:

  1. John Lyon approves this post. (Thank you!)

    ReplyDelete
  2. It's pretty good. Could you update it with Before-Save flows and After-Save flows please.

    ReplyDelete
  3. The order in salesforce docs (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers_order_of_execution.htm#!) is

    12. Executes escalation rules.
    13. Executes the following Salesforce Flow automations, but not in a guaranteed order.
    * Processes
    * Flows launched by processes
    * Flows launched by workflow rules (flow trigger workflow actions pilot)
    * When a process or flow executes a DML operation, the affected record goes through the save procedure.
    14. Executes entitlement rules.

    But it is different in this document. The order here is "process => Escalation => Entitlement" wheras the order in the doc is "Escalation => Process => Entitlement".

    I am new to salesforce. Does this difference matter?

    ReplyDelete
  4. It’s a great and useful piece of info. I’m happy that you just shared this useful info with us. Please stay informed like this. Thank you for sharing. Here’s another informative content on Salesforce for Nonprofits , find more details here.

    ReplyDelete