Error: Too Many SOQL Queries
Issue
While syncing data to a Salesforce destination, records are rejected with the following message:
CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY:MyCoolTrigger: System.LimitException: SBQQ:Too many SOQL queries: 101
Environment
Activations Destination: Salesforce
Resolution
To resolve this issue, review the Apex trigger or automation named in the error message and make the following changes as needed:
- Move SOQL queries outside loops.
- Reuse query results instead of running the same query multiple times.
- If the error includes
SBQQ, review your Salesforce CPQ automation and customizations for excessive query usage.
For more information, see the Salesforce documentation on bulk Apex triggers.
If query usage remains too high, consider moving suitable work to asynchronous Apex. For more information, see the Salesforce documentation on scheduling Batch Apex with System.scheduleBatch().
Cause
This issue occurs when Salesforce processes a batch of records and the related trigger or automation exceeds the SOQL query limit for a single transaction.
Activations sends data in batches, so automation on the target object must support bulk processing. Queries inside loops and complex Salesforce CPQ logic can cause the transaction to exceed the limit.