What is mixed-save processing order and how does it affect developers?
Suggested answer
Mixed-save processing occurs when a single save request affects multiple related records (e.g., saving an Account with a child Contact in one request, or a master-detail cascade). Processing order for a single save:
1. The record initiating the save is processed through the full order of execution (before triggers, validation, save to DB, after triggers).
2. Child records (if part of the same save) are processed next.
3. Cross-object updates triggered by workflow/flow fire in a subsequent pass. This matters because: a before trigger on Account fires before any Contact in the same request. After triggers see already-committed parent records. Cascade deletes on master-detail also follow an order — detail records fire delete triggers before the master's after trigger. Understanding this prevents bugs where developers assume all records in a request are in the same trigger context.
Practice content for interview preparation; not an official vendor answer. Verify details against current product documentation.
Community comments (0)
No comments yet.
Sign in or create a free account to add a comment. Comments are moderated before they appear.