A Salesforce Administrator needs to build a record-triggered flow on the Opportunity object that aggregates the Grand Total of all open Quote records related to the parent Account and updates a custom field on that Account, adhering strictly to bulkification best practices. Place the following Flow Builder steps in the correct execution order from first to last.
- 1Execute a Get Records element to retrieve all Quote records where AccountId equals $Record.AccountId and Status does not equal 'Closed' into a record collection variable.
- 2Pass the retrieved Quote record collection into a Loop element to process each record individually.
- 3Use an Assignment element within the loop's 'For each item' path to add the current Quote's Grand Total value to a running total variable.
- 4Use an Assignment element on the 'After last item' path to assign the accumulated total variable and the Account Id to an Account record variable.
- 5Execute a single Update Records element using the prepared Account record variable to commit the updated total to Salesforce.
Cevap
The correct sequence of Flow Builder steps is: First, execute a Get Records element to fetch all relevant Quotes. Second, pass the collection into a Loop element. Third, assign each Quote's Grand Total to a running variable inside the loop. Fourth, set the Account record variable fields using an Assignment element after the loop completes. Finally, execute an Update Records element to commit the changes.
The correct design pattern follows bulkification best practices in Salesforce Flow Builder: initial query via Get Records, iteration over collection elements in a Loop, in-memory calculation using Assignment within the loop path, single record assignment after the loop completes, and a final database update via Update Records outside the loop.
Adım Adım Çözüm
Anahtar Kavram
Flow Bulkification and Element Sequencing