You need to sign in to do that
Don't have an account?
Rakesh S
system.limitException: Too many query rows:50001
Hi All,
i want to get all class dates more than today. But I got the following exception while Controller and test class moving to Production.
System.limitException: Too many query rows:50001.
this is my method:
In production, i got only 100 records for this query like
[SELECT Class_Date__c FROM Class_Book__c where Class_Date__c >= Today GROUP BY Class_Date__c];
How can i achieve this problem. Any one please help me.
Thank you.
i want to get all class dates more than today. But I got the following exception while Controller and test class moving to Production.
System.limitException: Too many query rows:50001.
this is my method:
public List < SelectOption > getClassDate() { // Error coming below line. List < AggregateResult > listOFClassDates = [SELECT Class_Date__c FROM Class_Book__c where Class_Date__c >= Today GROUP BY Class_Date__c]; List < SelectOption > listOfSelectOption = new List < SelectOption > (); listOfSelectOption.add(new Selectoption('0', 'Please Select')); for (AggregateResult lb: listOFLogBook) { Date dt = (date) lb.get('Class_Date__c'); dateStr = string.valueOf(dt.month()) + '/' + string.valueOf(dt.day()) + '/' + string.valueOf(dt.year()); listOfSelectOption.add(new Selectoption(string.valueOf(dt), dateStr)); } return listOfSelectOption; }
In production, i got only 100 records for this query like
[SELECT Class_Date__c FROM Class_Book__c where Class_Date__c >= Today GROUP BY Class_Date__c];
How can i achieve this problem. Any one please help me.
Thank you.
Can you please post your test class here?
Thank You,
Hitesh Patel
Email :- hiteshpatel.aspl@gmail.com
http://mrjavascript.blogspot.in/
This is my test class. I got error at " sta.getScheduledDate(); "
Remove the "(SeeAllData=true)" statement from your rest class. this is not a best practice to write a test class.
remove it and try to deploy it again.
Thank You,
Hitesh Patel
Email :- hiteshpatel.aspl@gmail.com
http://mrjavascript.blogspot.in/