You need to sign in to do that
Don't have an account?

How to retrieving more than 10K records
I have page, Which inturn contains picklists like category when I select one category then the data related to that catogory must be displayed in the table.. Which is all working fine (page/class)but I am getting an error saying ,Too many query rows: 10001.. So can anyone, help me work around this problem...
Use nested List to fetch more than 10K records :
List<List<Account>> ListListAcc = New List<List<Account>>();
List<Account> ListAcc;
for(Integer i=0; i<5; i++)
{
ListAcc = [Select id, name From Account limit 10000];
ListListAcc.add(ListAcc);
}
for(List<Account> ListA : ListListAcc)
{
for(Account ac : ListA)
{
// Display account records
}
}
All Answers
The solution to your issue lies in using javascript API.
Use nested List to fetch more than 10K records :
List<List<Account>> ListListAcc = New List<List<Account>>();
List<Account> ListAcc;
for(Integer i=0; i<5; i++)
{
ListAcc = [Select id, name From Account limit 10000];
ListListAcc.add(ListAcc);
}
for(List<Account> ListA : ListListAcc)
{
for(Account ac : ListA)
{
// Display account records
}
}
Hello Pradeep,
Will List doesnt support records over 1000, so query limit should be 1000 and not 10000? Am I right?
Limits on the number of items in a collection has been removed in Spring 10. However, there's still a general limit on heap size.
Thanks alot Pradeep!!
Sarkari Yojana (https://www.sarkariyojnaa.com/)
Sarkari Yojana https://sarkariyojanai.com/