Question

Difficulty: HardOrder of Execution and Automation Considerations

When a customer support agent updates a Case record, several automated processes and validation mechanisms are triggered. Place the following automation events in the exact sequence in which Salesforce processes them during the record save operation.

  1. 1Before-Save Record-Triggered Flows update field values on the record.
  2. 2Custom Validation Rules evaluate field criteria against current values.
  3. 3Case Assignment Rules evaluate criteria to reassign record ownership.
  4. 4After-Save Record-Triggered Flows process post-save logic and related record updates.
  5. 5Parent record Roll-Up Summary fields are recalculated.

Answer

The correct order of execution is: 1) Before-Save Record-Triggered Flows, 2) Custom Validation Rules, 3) Case Assignment Rules, 4) After-Save Record-Triggered Flows, 5) Parent record Roll-Up Summary updates.
Salesforce processes save operations in a strict sequence: Before-Save Record-Triggered Flows execute first, followed by Custom Validation Rules. After the initial database save, Case Assignment Rules execute, followed by After-Save Record-Triggered Flows. Finally, parent record Roll-Up Summary fields are recalculated near the end of the transaction.

Step-by-Step Solution

1
Evaluate pre-save automation events
Before-Save Record-Triggered Flows execute first to modify record fields before database operations or validation.
Salesforce prioritizes fast before-save flow evaluations prior to validation and Apex execution.
2
Evaluate data quality enforcement
Custom Validation Rules run next to verify data integrity against any changes made by the user or before-save flows.
Custom validation ensures invalid data is rejected before saving changes into the database layer.
3
Evaluate initial post-save rules
Case Assignment Rules evaluate after the record is saved to the database but before after-save flow logic runs.
System assignment rules run immediately after initial database write and after-trigger processing.
4
Evaluate post-save flow automation
After-Save Record-Triggered Flows execute to perform actions like creating related records or sending notifications.
After-save flows execute after workflow and assignment rules complete.
5
Evaluate parent object calculations
Roll-Up Summary fields on parent records recalculate.
Parent roll-up summaries are updated after child record automation and deferred operations finish.

Key Concept

Salesforce Order of Execution during record save operations
Rate this question