Question

Difficulty: MediumFlow Builder Elements and Logic

A Salesforce Administrator is building an After-Save Record-Triggered Flow on the Asset object. When an Asset's Status field is changed to 'Obsolete', all open child Cases associated with that Asset must have their Status updated to 'Closed - Asset Replaced'. Which element configuration best achieves this requirement while adhering to Salesforce governor limits and bulkification best practices?

  1. Execute a Get Records element to collect open Cases, loop through the collection, use an Assignment element inside the loop to set the new Status on the loop variable and add it to a new collection variable, then execute a single Update Records element after the loop.Answer
  2. B
    Execute a Get Records element to collect open Cases, loop through the collection, and place an Update Records element inside the loop to commit field changes on each Case record individually.
  3. C
    Create a Roll-Up Summary field on the Asset object to aggregate child Cases, and use a Before-Save Record-Triggered Flow to automatically update the child Case records directly.
  4. D
    Use a Decision element inside a loop to update the Case Record Type picklist assignment directly, avoiding the need for Get Records or Update Records elements.

Answer

The recommended solution is to execute a Get Records element to retrieve open child Cases into a collection, iterate through them using a Loop element while updating values in a secondary collection via Assignment elements, and execute a single Update Records element outside the loop.
The option advocating a Get Records element followed by a Loop with Assignment elements and a single Update Records element outside the loop correctly implements Salesforce flow bulkification design patterns. By accumulating modified record variables in a new collection variable during iteration and executing DML outside the loop, the flow uses only one DML statement regardless of how many child Cases are updated.

Step-by-Step Solution

1
Query related records using Get Records
Obtain a Record Collection variable containing all open child Cases linked to the triggering Asset record.
Retrieves child data in bulk prior to processing.
2
Iterate through records using a Loop element and perform Assignments
Update the Status field on the current loop item record variable, and assign that modified variable into a new target Record Collection variable.
Modifies data in memory within the loop without issuing DML calls to the Salesforce database.
3
Execute a single Update Records element after the loop completes
Persists all status changes for the entire record collection in a single database transaction.
Ensures the flow remains bulkified and avoids hitting SOQL or DML governor limits.

Key Concept

Flow Bulkification and Element Logic
Estimated Time:1m 30s
Rate this question