A Salesforce Administrator needs to build a daily Schedule-Triggered Flow that processes expired Subscription custom records and updates their parent Account records with the aggregated renewal values. The Subscription object is related to Account via a Lookup relationship. Which design approach using Flow Builder elements accurately satisfies this requirement while respecting governor limits?
- Use a Loop element to iterate through the retrieved Subscriptions, an Assignment element inside the loop to calculate updated values into record variables, and a single Update Records element placed after the loop finishes.Cevap
- BPlace an Update Records element inside the Loop element to immediately save changes to each parent Account record during every iteration.
- CCreate a Roll-Up Summary field on the Account object to automatically calculate the total subscription sum without needing Flow Builder logic.
- DUse an Assignment element inside the loop to commit field modifications directly to the database without needing an Update Records element.
Cevap
Use a Loop element to iterate through retrieved records, an Assignment element inside the loop to modify values in memory, and an Update Records element outside the loop to execute a single bulkified DML operation.
The correct approach bulkifies the flow by utilizing an Assignment element within the loop to calculate aggregate values in memory, followed by executing a single Update Records element outside of the loop after iteration concludes.
Adım Adım Çözüm
Anahtar Kavram
Flow Bulkification and Governor Limits