Soru

Zorluk: OrtaFlow Builder Elements and Logic

A company requires an automated batch process to calculate the total contract value of all active child contracts linked to an account and update the parent account record. Order the Flow elements from first to last to accomplish this while maintaining bulkification best practices.

  1. 1Get Records element to query all active Contract records related to the Account.
  2. 2Loop element to iterate over the collection of retrieved Contract records.
  3. 3Assignment element to add the current Contract's amount to a running total variable.
  4. 4Update Records element to update the parent Account with the final calculated total.

Cevap

The correct sequence is: Get Records element to query all active Contract records related to the Account -> Loop element to iterate over the collection of retrieved Contract records -> Assignment element to add the current Contract's amount to a running total variable -> Update Records element to update the parent Account with the final calculated total.
The proper sequence for bulkified record processing in Flow Builder is: retrieve records (Get Records), iterate through the records (Loop), perform in-memory variable calculations (Assignment inside the loop), and commit updates to the database once iteration finishes (Update Records).

Adım Adım Çözüm

1
Query the dataset using Get Records.
Collection variable is populated with target Contract records.
Data must be retrieved before iteration can occur.
2
Begin iteration with a Loop element.
Flow iterates through each item in the collection variable sequentially.
Allows element-level operations on each item.
3
Aggregate values using an Assignment element inside the loop.
The running total variable accumulates values across all loop iterations.
In-memory variable manipulation avoids SOQL and DML limit violations.
4
Persist changes using an Update Records element after the loop completes.
Parent Account record is updated with the calculated total in a single DML operation.
Placing data operations outside the loop ensures compliance with Salesforce governor limits.

Anahtar Kavram

Flow Builder Bulkification and Data Manipulation Sequencing
Bu soruyu puanla