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
Gargi ManjeeGargi Manjee 

Update for 1k records in apex

Hi SF Devs,

If we try to update 2000k records in apex class will it through error?
What behaviour we can expect for the same?

Kindly share your expertise.
Best Answer chosen by Gargi Manjee
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Gargi,

For those many records it is always best to use batch class to update. A batch class can update up to 50 million records. 

In normal Apex class you can update maximum of 10000 records only.

If this solution helps, Please mark it as best answer.

Thanks,
 

All Answers

Sai PraveenSai Praveen (Salesforce Developers) 
Hi Gargi,

For those many records it is always best to use batch class to update. A batch class can update up to 50 million records. 

In normal Apex class you can update maximum of 10000 records only.

If this solution helps, Please mark it as best answer.

Thanks,
 
This was selected as the best answer
Gargi ManjeeGargi Manjee
Thank you Sai!