You need to sign in to do that
Don't have an account?
VSK98
How can we retrieve more than 50k records in apex class
Hi All,
As we know in batch class, we can able to retrieve more than 50k records but in normal apex class i need to fetch more than 50K records.Is there any workaround?
Regards,
VSK98
As we know in batch class, we can able to retrieve more than 50k records but in normal apex class i need to fetch more than 50K records.Is there any workaround?
Regards,
VSK98
You should look at using Batch Apex to accomplish your goals.
You cannot retrieve more than 50,000 records your SOQL calls in a single context.
However, with Batch Apex your logic will be processed in chunks of anywhere from 1 to 200 records in a batch.
You'd need to modify your business logic to take the batching into account if necessary.
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_batch_interface.htm
Hope this will help you. Let me know if it helped or you need any more assistance.
Please mark this is as the solution if it solved your purpose.
Thanks,
Sohan Raj Gupta
You can try through REST API.
Or if you are having VF page for the class, then use @ReadOnly annotation.
plz let me know if this idea works for you...
Thanks
Niraj
Consider the below link try for it hope it will help you.
http://www.exampeta.com/article/agpzfmV4YW1wZXRhchULEghBcnRpY2xlcxiAgIDg5ay9Cww/Fetch-more-than-50000-records-by-SOQL
https://force746.wordpress.com/2014/08/28/count-large-number-of-records-more-than-50000/
Thanks
Akshay