Salesforce recommends avoiding DML operations (such as creating or updating records) inside loops when designing flows. Performing such actions inside a loop can cause performance issues and exceed governor limits, especially if the loop iterates over a large data set.
Correct Practice:
Use the Assignment element inside the loop to collect data into a variable (like a collection).
After the loop completes, perform DML operations outside the loop using a single Update or Create Records element.
Incorrect Options:
B. Displaying data is not typically done inside loops, but it is not a best-practice concern.
C. Assigning values to variables inside a loop is acceptable.
D. Nesting another loop is discouraged, but not as problematic as performing DML operations inside a loop.
Reference Extracts from Salesforce Help Documentation on Flow Best Practices:
“Avoid DML operations and SOQL queries inside a loop to prevent hitting governor limits.”
“Use collection variables and perform record operations after the loop.”
===========
Submit