Soru

Zorluk: OrtaFlow Builder Elements and Logic

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?

  1. 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
  2. B
    Iterate 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.
  3. C
    Create 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.
  4. D
    Change 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

1
Identify the performance and bulkification requirement
DML operations (such as Update Records) must be executed outside of loops to respect Salesforce governor limits.
Salesforce enforces strict governor limits per transaction on DML statements.
2
Construct the collection in Flow Builder
Use Get Records to fetch child records, loop through the collection, update values in an Assignment element, and append each updated item to a new collection variable.
This accumulates changes in memory without invoking database updates inside the loop iteration.
3
Execute database update
Pass the populated collection variable to a single Update Records element placed after the loop completes.
A single DML statement updates all records in the collection efficiently within governor limits.

Anahtar Kavram

Bulkification in Flow Builder using Assignment and Collection Variables outside of Loops
Tahmini Süre:1m 30s
Bu soruyu puanla