A Salesforce Administrator needs to design an autolaunched flow that processes a list of inactive Partner Account records passed into the flow. For all open Opportunities associated with these Partner Accounts, the flow must update their Stage to 'Closed Lost'. To adhere to governor limits and bulkification best practices, all database modifications must occur outside any iteration loops. Arrange the Flow Builder elements in the correct sequential order to construct this bulkified automation.
- 1Get Records element to query all open Opportunity records where AccountId is in the input Partner Account collection.
- 2Loop element to iterate over the retrieved Opportunity record collection.
- 3Assignment element to set the StageName field of the current Opportunity loop item to 'Closed Lost'.
- 4Assignment element to add the modified current Opportunity loop item to a new Opportunity Record Collection variable.
- 5Update Records element placed after the loop finishes to update all records in the staging Opportunity Record Collection variable.
Answer
The correct sequence starts with retrieving the related records, looping through the retrieved collection, assigning updated field values to the loop item, adding the item to a secondary staging collection, and executing a single DML update outside the loop.
The proper design for handling child records in Salesforce Flow Builder follows the bulkification pattern: Get Records -> Loop -> Assignment (Modify Field) -> Assignment (Add to Collection) -> Update Records (Outside Loop). This guarantees that queries and DML operations execute exactly once per transaction regardless of collection size.
Step-by-Step Solution
Key Concept
Flow Bulkification and Element Sequencing