You need to sign in to do that
Don't have an account?
number of query rows governor limit warning...
Received the following error in an email when I was just playing with some code in the developer console.
Apex governor limit warning email below:
----------------------------------------------------------------------------------------------
Operation: execute_anonymous_apex.Lead
By user/organization: 005A0000000ZeAg/00DA0000000JRJD
Caused the following Apex resource warnings:
Number of query rows: 35081 out of 50000
(these emails can be disabled from the user detail page for this user)
----------------------------------------------------------------------------------------------
My code was simply this:
for(Lead[] myleads : [select id, FirstName FROM Lead])
{
system.debug(myleads.size());
}
My question:
If I have more than 50K rows in the Lead table, how would one be able to query the records in this table to effectively access all the records? I don't yet have a use case, but I'd imagine that someone would need to query all records of a table for some process, and how to go about it when the records in the table exceeds that of the governor limit.
Thanks,
Frank
If you want to access more than 50000 records.
You need to write a batch class.
check this link for more info:- http://boards.developerforce.com/t5/Apex-Code-Development/Fetch-more-than-50000-records-by-SOQL/td-p/359733
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_batch_interface.htm
All Answers
If you want to access more than 50000 records.
You need to write a batch class.
check this link for more info:- http://boards.developerforce.com/t5/Apex-Code-Development/Fetch-more-than-50000-records-by-SOQL/td-p/359733
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_batch_interface.htm
@anilbathula@,
Thanks so much! Simple, Sweet, and Awesome!