A company requires that when an Account record is set to 'Inactive', all associated open Service Contract records must automatically have their status updated to 'Canceled'. To ensure the automation processes bulk record updates efficiently without triggering DML governor limits, how should the administrator construct the elements within Flow Builder?
- Use a Get Records element to retrieve open contracts, iterate through the collection with a Loop element, update the status in a record variable using an Assignment element, add each record variable to a record collection variable using a second Assignment element, and invoke a single Update Records element after the loop completes.Cevap
- BUse a Get Records element to retrieve open contracts, iterate through the collection with a Loop element, and place an Update Records element inside the loop to persist changes on each record individually.
- CConfigure the flow as a Fast Field Updates (before-save) record-triggered flow on Account, retrieve the open contracts, and update the related contracts using an Assignment element directly.
- DCreate a Roll-Up Summary field on the Account object that updates the status field on all related child Service Contract records automatically.
Cevap
The flow should retrieve the child records using a Get Records element, loop through them while modifying values and accumulating the items into a record collection using Assignment elements, and then execute a single Update Records element outside the loop.
The correct approach retrieves child records, modifies field values in memory using loop iteration and Assignment elements to build a new record collection variable, and executes a single Update Records DML operation after the loop ends. This pattern ensures the flow is fully bulkified.
Adım Adım Çözüm
Anahtar Kavram
Flow Bulkification and Element Design Patterns