An administrator is designing an autolaunched flow in Salesforce to update thousands of high-priority Account records and their associated Contacts whenever a custom status field changes. To meet performance guidelines and avoid hitting SOQL query and DML statement governor limits, the flow must handle data operations efficiently across collections. Which TWO actions should the administrator take to process these records without violating governor limits?
- Execute a Get Records element before entering the loop to retrieve all necessary records into a Record Collection Variable.Cevap
- Use an Assignment element inside the loop to add updated record variables to a Record Collection Variable, followed by a single Update Records element outside the loop.Cevap
- CPlace an Update Records element inside the Loop element to immediately save changes for each individual record during iteration.
- DAdd a Get Records element inside the Loop element to query related Contact records dynamically on each iteration cycle.
Cevap
The administrator should execute a Get Records element prior to the loop to populate a collection variable and use an Assignment element inside the loop to accumulate modified records into a collection, executing a single Update Records element outside the loop.
Bulkifying flows requires moving all database interactions outside of loop containers. Querying records before entering the loop retrieves data in a single SOQL statement, and gathering updated record variables into a collection variable via Assignment elements allows a single Update Records DML operation outside the loop to commit all updates simultaneously.
Adım Adım Çözüm
Anahtar Kavram
Flow Bulkification and Governor Limits