You need to sign in to do that
Don't have an account?
Pavani Akella 9
How to avoid SOQL query exception
An installed package(Declarative Lookup Rollup summary) has an automated trigger. This trigger is resulting in throwing "dlrs_CaseTrigger: System.LimitException: dlrs:Too many SOQL queries: 101" error when Salesforce is receiving batch insert of cases. How do I move the trigger to not throw SOQL query exception.
trigger dlrs_CaseTrigger on Case
(before delete, before insert, before update, after delete, after insert, after undelete, after update)
{
dlrs.RollupService.triggerHandler();
}
Thanks in advance
trigger dlrs_CaseTrigger on Case
(before delete, before insert, before update, after delete, after insert, after undelete, after update)
{
dlrs.RollupService.triggerHandler();
}
Thanks in advance
Greetings to you!
The following error appears when you exceed the Execution Governors Limit (you can run up to a total 100 SOQL queries in a single call or context).
To fix this problem you have to take your SOQL out of the for loop.
Best practices to avoid exceeding the Governors Limit :
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future.
Thanks and Regards,
Khan Anas
Are you referring to this tool: https://github.com/afawcett/declarative-lookup-rollup-summaries
If yes, then for this tool 101 SOQL exception is very hard to track down. It might possible that you have a lot of child records related to parent records you are rolling up on. Or, you have too many rollups defined to one parent.
However, you can refer to below links which might help you.
https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/276
https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/629
https://andyinthecloud.com/2014/02/09/new-release-spring14-declarative-rollup-summary-tool/
Regards,
Khan Anas