An organization requires an automated process on the Asset object. When an Asset's status is updated to Obsolete, all related custom Maintenance Request records that are currently Open must have their status updated to Cancelled. To ensure optimal performance and avoid reaching governor limits, how should the administrator configure the Flow Builder elements?
- Execute a Get Records element to retrieve open Maintenance Requests, iterate through them using a Loop element, update the status field using an Assignment element to populate a record collection variable, and execute a single Update Records element after the loop.Cevap
- BIterate through the open Maintenance Requests with a Loop element, update each record's status using an Assignment element, and execute an Update Records element inside the loop for each item.
- CCreate a Roll-up Summary field on the Asset object to count open Maintenance Requests and update the child records' picklist status using a single Assignment element.
- DChange the Record Type assignment on the Asset object so that picklist dependencies automatically update the status of related child records.
Cevap
The administrator should retrieve open Maintenance Requests using a Get Records element, process each record using a Loop and Assignment element to build an updated record collection, and execute a single Update Records element outside the loop.
To adhere to Salesforce bulkification best practices and governor limits, data manipulation elements (DML) such as Update Records must never be placed inside a Loop element. Instead, records should be modified in memory using Assignment elements, added to a collection variable, and updated in the database with a single Update Records element after the loop ends.
Adım Adım Çözüm
Anahtar Kavram
Bulkification in Flow Builder using Assignment and Collection Variables outside of Loops
Tahmini Süre:1m 30s