You need to sign in to do that
Don't have an account?
JAYESH RATHOR
How to handle Too many query rows: 50001 in apex class, In the below code
Here THIS_Month is a pick list value.
If(selectvalue =='THIS_Month')
{
List<AggregateResult> openCaseList= [SELECT Count(id),Status from Case Where RecordType.Name !='Return Case' AND CreatedDate <= THIS_MONTH Group By Status LIMIT 49999];
}
But I am getting Too many query rows: 50001
please give me any solution on it.
If(selectvalue =='THIS_Month')
{
List<AggregateResult> openCaseList= [SELECT Count(id),Status from Case Where RecordType.Name !='Return Case' AND CreatedDate <= THIS_MONTH Group By Status LIMIT 49999];
}
But I am getting Too many query rows: 50001
please give me any solution on it.
Please refer the below link for further reference.
- http://salesforce.stackexchange.com/questions/28228/system-limitexception-too-many-query-rows-50001
- http://salesforce.stackexchange.com/questions/105609/system-limitexception-too-many-query-rows-50001-even-though-soql-has-limit-10
I hope it will be helpful.Please mark it as best Answer if the information is informative.
Best Regards
Rahul Kumar