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
Austin_SteveAustin_Steve 

DML Limit Question

All,

 

I created a trigger to update a field on the Contacts object associated with a closed Opportunity.  Apparently one of our Accounts have more than 100 Contacts. I got an error that said  "caused by: System.Exception: Too many DML rows: 102"

What is the limit of records I can update in a single DML statement within a trigger?

 

Thank you in advance

 

Steve Hughes

 

Best Answer chosen by Admin (Salesforce Developers) 
_Prasu__Prasu_

 

Total number of records processed as a result of DML 1006 10,000 500
statements

 

Total number of records processed as a result of DML 100.

 

 

These limits scale with trigger batch size. The limit is multiplied by the number of records submitted. For example, if your

batch process contains 200 records, your script may retrieve as many as 200,000 records.

 

All Answers

_Prasu__Prasu_

 

Total number of records processed as a result of DML 1006 10,000 500
statements

 

Total number of records processed as a result of DML 100.

 

 

These limits scale with trigger batch size. The limit is multiplied by the number of records submitted. For example, if your

batch process contains 200 records, your script may retrieve as many as 200,000 records.

 

This was selected as the best answer
Austin_SteveAustin_Steve

Thank you that makes sense, I will limit the number of records I return. Although I think this Account is an anomaly.

 

Again Thanks