DML, API, and Remote Action calls from Loop Block
While virtually any Salesforce developer knows not to use database or external service calls in Apex loops, I have personally witnessed a surprisingly large number of OmniStudio applications where developers were applying similar logic without realizing the consequences.
Those apps have DataRaptors, HTTP, and remote actions sitting inside the Loop Block of the Integration Procedures. Perhaps, the declarative nature of Integration Procedures makes the developers feel that the rules of the Salesforce platform somehow do not apply. However, when SOQL queries and HTTP calls are run either from the inside of an Apex loop or from inside a Loop Block in an Integration Procedure, they impact performance and risk hitting governor limits the same way.
Let’s look at an example. The Integration Procedure shown in the following image extracts Quote
objects on its first step. Then, for each of the retrieved records, it queries and updates...