You need to sign in to do that
Don't have an account?
Samir Mahtani 4
Apex Issue/ " Failed to process batch"
We are getting continuous issues via email with the following message:
Apex script unhandled exception by user/organization: 00538000006N5EX/00D50000000JW2O
Failed to process batch for class 'c_component_allocation_bulk_sync' for job id '7071T00008jxauJ'
caused by: System.LimitException: Too many query rows: 50001
Class.c_component_allocation_change_container.priors: line 380, column 1
Class.c_component_allocation_change_container.positive_priors: line 334, column 1
Class.c_component_allocation_change_container.manage_updates: line 202, column 1
Class.c_component_allocation_change_container.process_state_change: line 100, column 1
Class.c_component_allocation_change_container.update_states: line 79, column 1
Class.c_component_allocation_change_container.<init>: line 66, column 1
Trigger.c_component_allocation_mod: line 13, column 1
Does anyone know what the issue might be? We are seeing issues with Chargify which is an integrated software.
Apex script unhandled exception by user/organization: 00538000006N5EX/00D50000000JW2O
Failed to process batch for class 'c_component_allocation_bulk_sync' for job id '7071T00008jxauJ'
caused by: System.LimitException: Too many query rows: 50001
Class.c_component_allocation_change_container.priors: line 380, column 1
Class.c_component_allocation_change_container.positive_priors: line 334, column 1
Class.c_component_allocation_change_container.manage_updates: line 202, column 1
Class.c_component_allocation_change_container.process_state_change: line 100, column 1
Class.c_component_allocation_change_container.update_states: line 79, column 1
Class.c_component_allocation_change_container.<init>: line 66, column 1
Trigger.c_component_allocation_mod: line 13, column 1
Does anyone know what the issue might be? We are seeing issues with Chargify which is an integrated software.
There is a limit to the number of records that that can be retrieved by the SOQL Query which is 50000 records. Attempting to query the records having the number more than this will give the error which you are getting.To query the records more than its limit, you need to use a Batch Class which provides a fresh limit of 50k records by resetting the limits.
References for more details:
https://salesforce.stackexchange.com/questions/28228/system-limitexception-too-many-query-rows-50001
https://salesforce.stackexchange.com/questions/105609/system-limitexception-too-many-query-rows-50001-even-though-soql-has-limit-10
Hope this helps..
Thanks
I recommend checking the debug logs. From the logs, see how many rows the SOQL query returns and run the same query through the workbench and verify if the query has a where clause and limit
For the sake of debugging note that you can check how many query rows have been used via Limits.getQueryRows();.