function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
CloudComputingSFDCCloudComputingSFDC 

To Fetch and process more than 50000 records.

How to fetch records more than 50000 (something around 70000) and then update it in "Update" DML statement.

SOQL can give you 50000 records and 1 DML can process 10000 records only.

Now how to overcome this situation ???

Please sugges.

 

kreshokresho

You can process as many records as you need using a batch process. See http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_batch_interface.htm

 

Regards,
Kresimir
Apex Editor LS - free alternative to Force.com apex editor.
Give kudos (click blue star under my icon) if this was useful

MagulanDuraipandianMagulanDuraipandian

Hi, Go with Batch Apex.

 

It supports upto 50 million records.

 

http://www.infallibletechie.com/2012/05/batch-apex.html

 

Regards,

Magulan D

sandeep@Salesforcesandeep@Salesforce

Using batch

souvik9086souvik9086

You can use batch apex for performing this operation.

 

You can fetch the query in the start method of the Batch Apex and then execute those by 200 record chunks in the execute method and then do the update there of those chunck of data.

 

If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.

Thanks

SachinSankadSachinSankad

Hi,

 

Use Batch Apex.

 

You can process 50 million records using batch apex.

 

Thanks,

Sachin.