An administrator is building an automation on the custom Course Offering object. When a Course Offering status is updated to 'Cancelled', the status of all associated Student Enrollment records must be changed to 'Cancelled'. To prevent hitting governor limits when updating large batches of enrollments, which approach should the administrator use to configure the Flow resources and data manipulation elements?
- AIterate through the retrieved enrollments using a Loop element, use an Update Records element inside the loop to modify each record directly, and end the flow.
- Iterate through the retrieved enrollments using a Loop element, assign the updated status to the loop item, add each item to a new collection variable using an Assignment element, and execute a single Update Records element after the loop finishes.Answer
- CConfigure a before-save (Fast Field Updates) record-triggered flow on Course Offering to update the related Student Enrollment records directly without using collection variables.
- DIterate through the enrollments and use a Get Records element inside the loop body to fetch each individual enrollment before applying changes directly to the parent record.
Answer
Iterate through the retrieved enrollments using a Loop element, assign the updated status to the loop item, add each item to a new collection variable using an Assignment element, and execute a single Update Records element after the loop finishes.
Bulkifying data manipulation in Salesforce Flow requires making all field modifications in memory using a Loop and Assignment elements, staging the modified records into a collection variable, and executing a single Update Records element after the loop path completes.
Step-by-Step Solution
Key Concept
Bulkification and Data Manipulation in Salesforce Flow
Estimated Time:1m 15s