Soru

Zorluk: Çok zorFlow Resources and Data Manipulation

An administrator is designing an after-save Record-Triggered Flow on the Opportunity object to recalculate custom pricing tiers across multiple child Opportunity Line Item records when an Opportunity reaches the 'Closed Won' stage. The flow must obtain the child records, filter out items tied to archived product families, update the unit price on eligible items, and commit the changes to the database. To ensure the flow is fully bulkified and performs reliably during mass record updates, which design pattern should the administrator implement?

  1. Query related Opportunity Line Items into a record collection variable using Get Records, refine the collection with a Collection Filter element, loop through the filtered collection using an Assignment element to modify field values and append each item to a new record collection variable, and execute a single Update Records element on the new collection outside the loop.Cevap
  2. B
    Query related Opportunity Line Items into a record collection variable, iterate through the collection using a Loop element with an embedded Decision element to check product family status, and place an Update Records element inside the loop path to persist each updated record immediately.
  3. C
    Configure the flow to execute before-save on the Opportunity Line Item object, and use a Get Records element inside an Assignment element to query parent Opportunity stage details dynamically before applying the pricing tier.
  4. D
    Use a Fast Field Update flow on Opportunity Line Item to perform inline record updates, using a decision matrix within a Loop element that bypasses system validation rules during transaction execution.

Cevap

The administrator should retrieve related child records into a collection, apply filtering using a Collection Filter element, update record values inside a loop by staging updated items into a target collection variable via Assignment elements, and execute a single Update Records element outside the loop.
To process data efficiently and maintain bulkification in Salesforce Flow, all database operations (Get, Create, Update, Delete) must be kept outside of loops. Utilizing a Collection Filter element allows filtering of records in memory. Modifying loop items and adding them to a secondary collection variable enables a single Update Records element at the end of the execution path to update all target records in a single bulkified DML operation.

Adım Adım Çözüm

1
Retrieve child records and apply collection filtering
Obtains all Opportunity Line Items for the parent record and reduces the collection to eligible records without executing extra SOQL queries.
Collection Filter processes records in-memory without consuming SOQL queries.
2
Iterate over the filtered collection and stage updates in a secondary collection variable
Each loop iteration updates the field values on the loop item variable and appends it to a target collection variable.
Staging modified records in a secondary collection ensures that individual DML statements are not executed inside the loop.
3
Execute DML update after loop completion
Passes the staged collection variable to a single Update Records element.
Executing DML operations outside the loop ensures the flow adheres to governor limits during bulk data operations.

Anahtar Kavram

Flow Data Bulkification and Collection Management
Tahmini Süre:3m 0s
Bu soruyu puanla