You need to sign in to do that
Don't have an account?
mwille64
Is there a way to analyse the total number of SOQL calls made in a chain of flows and apex triggers executed through a single trigger event
Scenario from our custom Salesforce apps:
A user creates a new Booking (custom object) via a dialog that allows the user to add a number of default Services (custom object), as well as to add one or more students (Contact object).
This in turn triggers a number of flows that create the sudent, link it via a generic junction object to the booking, this in turn triggers a flow that creates the services and assigns the student to the services.
The Services are then calculated in terms of the sales and cost prices and when all is done the Booking is updated with the total value.
A few more things happen, which leads aside from all the optimisations I have implemented, to the famous SOQL 101 error when the number of default services exceeds about 6-8.
The problem is that each custom object has at least one flow attached that is triggered under certain rules. I find it absolutely impossible to trace exactly what is happening.
So the question is, is there a way in Salesforce or a 3rd party tool that can properly trace flow and trigger execution and comes up with an execution table and the number of SOQL calls made.
This would greatly help to see if there are any SOQL calls triggered that shouldn't be and ultimately allow to add further execution rules for unneccessary triggered flows and Apex triggers.
A user creates a new Booking (custom object) via a dialog that allows the user to add a number of default Services (custom object), as well as to add one or more students (Contact object).
This in turn triggers a number of flows that create the sudent, link it via a generic junction object to the booking, this in turn triggers a flow that creates the services and assigns the student to the services.
The Services are then calculated in terms of the sales and cost prices and when all is done the Booking is updated with the total value.
A few more things happen, which leads aside from all the optimisations I have implemented, to the famous SOQL 101 error when the number of default services exceeds about 6-8.
The problem is that each custom object has at least one flow attached that is triggered under certain rules. I find it absolutely impossible to trace exactly what is happening.
So the question is, is there a way in Salesforce or a 3rd party tool that can properly trace flow and trigger execution and comes up with an execution table and the number of SOQL calls made.
This would greatly help to see if there are any SOQL calls triggered that shouldn't be and ultimately allow to add further execution rules for unneccessary triggered flows and Apex triggers.
Debug logs is only way to check and analyse SOQL calls made in apex, flow, trigger etc., Set debug level to finest and execute functional flow to check which operation is taken more time to execute and having multiple loops which might be hitting salesforce governor limits.
https://help.salesforce.com/s/articleView?id=000392579&type=1
https://help.salesforce.com/s/articleView?id=sf.code_debug_log_details.htm&type=5
There is no short way to debug immediately and find out reason for SOQL 10, you would need to review functional flow and review each component involved.
Please mark as Best Answer if above information was helpful.
Thanks,
I'm aware of the logs. But it is way too cumbersome to use the debug logs as a trace log for a particular event's 'trigger tree'. Debugging is limitted to the current flow opened for debugging. One can't debug what is triggered by the debugged flow.
So either way, the provided functionality - as far as I understand it - is only useful up to a certain level of complexity. After that the current log and debugging implementation is useless (pardon for being frank here).
I stand corrected.
was the current flow triggered by another flow?
if yes, which one?
what is the current bounce level?
The same applies to Apex triggers.
I solved my problem using the tedies dry work of charting step by step what the various flows and triggers are doing. This allowed me to I eliminate a few unneccessary double calculations/object updates and to optimise in terms of total number of calls. I'm for now back with in limits.
Having said this, Salesforce should provide better tools for developers to analyse flow and trigger activities.