An administrator needs to build a record-triggered flow that updates a custom field on all child Opportunity Line Items when an Opportunity reaches the Closed Won stage. To adhere to Salesforce bulkification best practices and avoid exceeding governor limits, in which sequence should the Flow Builder elements be executed?
- 1Get Records element to retrieve all Opportunity Line Item records related to the triggering Opportunity ID.
- 2Loop element to iterate through the retrieved collection of Opportunity Line Item records.
- 3Assignment element inside the loop to set the values for the updated fields on the current loop item.
- 4Assignment element inside the loop to add the current loop item to a new Record Collection variable.
- 5Update Records element placed outside the loop to update the Record Collection variable.
Cevap
The correct execution order is: 1) Get Records element to retrieve related child records, 2) Loop element to iterate through the collection, 3) Assignment element inside the loop to set field values on the current item, 4) Assignment element inside the loop to add the current item to a separate collection variable, and 5) Update Records element placed outside the loop to execute the bulk update.
Following the standard bulkification pattern in Flow Builder requires obtaining records into a collection, iterating through them with a loop, assigning modified values to the current loop item in memory, adding that item to a new collection, and performing a single Update Records DML action outside the loop once all iterations complete.
Adım Adım Çözüm
Anahtar Kavram
Flow Builder Bulkification and Element Sequencing