You need to sign in to do that
Don't have an account?
Developer_shaan
Retrieve more than 1000 records using soql query.
This might be a silly question but i am unable to fix it.
I have an custom object created in sfdc which has more than 1000 records say 10000 records. But i am able to retrieve only 1000 records above that it is throwing an error , so how to retrieve the 10000 records using soql query.
Note: i dont want to apply limit here. I want to retrieve all the records.
Please let me know if any soln for this...
thanks
shaan
You cannot retrieve more than 10,000 records as that is a strict governor limit. If you are trying to do some processing on top of those records, i would suggest that you look at Apex batch to iterate over a very large number of records.
Shaan - using the following syntax, you can retrieve a max of 10,000 (not 1000) records:
The only way to process more than 10,000 records is via Batch Apex.
You can retrieve upto 10,000 recods, in batches in 200 (the implicit query more pattern).
for (List<Account> accts : [Select id from account])
{
//The accts list will have 200 records at a time
for (Account a : accts)
{
…
}
}
How about an soql to do that. I need to do that as I need to use PHP code from my website to query data from Salesforce.
I have found it down. Just use queryMore()