Too many DML rows – 10001 error: An Ultimate Guide for 2026

If you work with Salesforce, there is one error that can suddenly stop your automation, break your trigger, or fail your data upload in seconds:

System Limit Exception Too many DML: rows 10001

If you have ever seen this error on the screen you must be aware of the stress you are filled with. However, this is a very common error that everyone will face in routine, but once you understand why this happens, fixing it becomes much easier for you.

In this blog, we will get to know more about the 10001 error code in Salesforce in the simplest possible way. You will learn what this 10001 error means, why Salesforce shows it, what causes it, and how you can permanently fix and avoid it in the future. Whether you are a beginner, Salesforce admin, developer, or business owner, this blog will help you in understanding everything clearly.

What Does Too Many DML: Rows 10001 Mean in Salesforce?

To understand the error, let us first understand the message itself. When Salesforce says System Limit Exception Too many DML rows: 10001, it simply means that your Salesforce process tried to update, insert, delete, or modify more than 10,000 records in a single transaction. But it can’t.

Because salesforce has a limit that allows only 10,000 DML rows in a single transaction. The moment your process touches the 10,001st record, Salesforce immediately stops the transaction and throws this error. Now you may ask……

What Are DML Rows?

DML stands for Data Manipulation Language. In Salesforce, DML operations are actions like:

  • Insert
  • Update
  • Delete
  • Upsert
  • Undelete

Every record affected by these actions counts as a DML row. For ex:

  • Updating 50 Contacts means 50 DML rows
  • Deleting 500 Leads means 500 DML rows
  • But the moment you inserting 10,001, it means the Accounts means the transaction fails

This is why the error is called: Too many DML rows: 10001, Because the Salesforce only allows 10,000 rows at one time.

Why Salesforce Has Governor Limits

Many beginners wonder why Salesforce even has these restrictions. Why not simply allow unlimited updates?

And the answer for that is simple. Salesforce is a cloud platform shared by millions of companies around the world. Where every company uses the same system and infrastructure. If one company runs extremely heavy processes without limits, the entire platform could slow down for everyone else using it.

To prevent this, Salesforce created rules called Governor Limits. Governor limits protect system performance and make sure every user gets fair resources.

Think about it like a school library. If one student takes all the books, nobody else can study. So the library creates rules about how many books one person can borrow at a single time.

Salesforce works in the same way. That is why Salesforce limits:

  • SOQL queries
  • CPU time
  • Heap size
  • API calls
  • DML operations

The 10001 error code in Salesforce is one of these governor limits.

Common Situations Where the 10001 Error Happens

This error can appear in many places inside Salesforce. Let’s look at the most common scenarios.

Apex Triggers Updating Too Many Records

Apex triggers are one of the biggest reasons behind this error. Imagine you create a trigger on the Account object. Whenever an Account updates, the trigger updates related Contacts. Sounds simple, right? But what if one Account has 15,000 Contacts?

The moment the trigger runs, Salesforce tries to update all 15,000 Contacts in one transaction. Since the limit is only 10,000 DML rows, Salesforce immediately throws the error. This becomes even more dangerous when triggers call other triggers.

For ex:

  • Account trigger updates Contacts
  • Contact trigger updates Opportunities
  • Opportunity trigger updates Accounts again

Now multiple automations start running together, and the number of DML rows increases very quickly. That leads in showing error 1001

Salesforce Flows Causing the 10001 Error

Flows are powerful because they allow admins to automate work without coding. But badly designed flows can create huge performance issues. One common mistake is updating all the records with inside loops.

Suppose a flow loops through 12,000 Contacts and updates each one separately. Salesforce counts every update, and eventually the process crosses the 10,000-row limit.

Scheduled flows are also a common reason behind this issue. Many companies create scheduled flows that run every night and process thousands of records together. If the flow is not optimized properly, the transaction fails.

This is why flow optimization is extremely important in Salesforce.

Data Loader and Migration Problems

The Too Many DML Rows: 10001 error is very common during data migration projects. Imagine a company importing:

  • 50,000 Contacts
  • 100,000 Leads
  • 80,000 Cases

At first, the upload seems normal. But behind the scenes, triggers, flows, and workflows start running automatically for every record.

Suddenly Salesforce is trying to process massive amounts of data in one transaction. In result the import fails with the 10001 error. This often happens during:

  • CRM migrations
  • Bulk uploads
  • Data cleanup
  • Integration syncs
Recursive Automation in Salesforce

Recursive automation is another major reason behind this issue. It means a process that keeps triggering itself again and again in a loop. For ex:

  1. Flow updates Account
  2. Account trigger updates Contact
  3. Contact flow updates Account again
  4. Account trigger runs again

This cycle continues repeatedly until Salesforce hits the governor limit. Even this automation is dangerous because it increases DML rows very fast without developers realizing it.

Understanding the Real Root Cause

Most people think the problem is “too much data.” But actually, the real problem is usually:

  • Poor automation design
  • Non-bulkified code
  • DML operations inside loops
  • Recursive triggers
  • Inefficient flows

Salesforce can handle huge amounts of data when processes are designed properly. But the main problem arises when developers or admins do not optimize their logic for bulk processing.

DML Inside Loops

One of the most common coding mistakes in Salesforce is placing DML operations inside loops. Here is a bad example:

for(Contact con : contactList){update con;}

This code updates records one by one. If the list contains thousands of records, Salesforce consumes DML limits very quickly. Now look at the optimized version: update contactList;

This updates all records together in a single operation and this concept is called: Bulkification. Now you wonder what exactly a Bulkification in Salesforce is?

Bulkification means designing code and automation to handle many records together instead of one at a time. Salesforce almost never processes records individually in real life.

For ex:

  • Data Loader imports records in bulk
  • API integrations send records in bulk
  • Flows often process multiple records together
  • Triggers can receive 200 records at once

If your logic only works for one record, governor limits will eventually break your system. This is why Salesforce developers must always think: “What happens if thousands of records run together?”

Difference Between DML Statements and DML Rows

Many beginners get confused between these two limits DML statement and DML row

Let’s simplify it.

DML Statements: This is the number of DML commands used. Ex:
update contacts;
insert accounts;
delete leads;

And Salesforce allows: 150 DML statements per transaction

DML Rows: This is the number of records affected.

If: update contacts; contains:

  • 10 Contacts = 10 DML rows
  • 5000 Contacts = 5000 DML rows

Salesforce allows:

  • 10,000 DML rows per transaction

Understanding this difference is extremely important for troubleshooting Salesforce governor limit errors.

How to Fix the 10001 Error Code in Salesforce

Now let’s discuss the practical solutions.

1. Bulkify Your Code

Always use collections and update records together.

Instead of: for(Account acc : accountList){ update acc;}
Use: update accountList;

This simple change can massively improve performance.

2. Avoid DML Operations Inside Loops

Never insert, update, or delete records directly inside loops.

Instead:

  • Store records in a list
  • Perform one DML operation outside the loop

This is one of the easiest ways to reduce DML usage.

3. Use Batch Apex for Large Data Volumes

When working with huge datasets, Batch Apex is the best solution. Batch Apex breaks records into smaller chunks. Instead of processing:

  • 50,000 records together

Salesforce processes:

  • 200 records at a time

This prevents governor limit issues.

Batch Apex is commonly used for:

  • Mass updates
  • Scheduled jobs
  • Data cleanup
  • Background processing

4. Optimize Salesforce Flows

Many Salesforce admins forget that flows also follow governor limits. To optimize flows:

  • Avoid updates inside loops
  • Use collection variables
  • Add proper filters
  • Avoid routing the file through Apex
  • Reduce unnecessary automation
  • Combine duplicate flows

Simple and clean flows perform much better.

5. Prevent Recursive Triggers

Recursive triggers can destroy performance. Developers usually solve this using static variables that stop triggers from running repeatedly. This prevents endless automation loops and reduces DML consumption.

6. Reduce Integration Batch Size

If integrations send huge batches of records, reduce the batch size. Instead of sending 10,000 records together try to send in chunks like 200 or 500 records at a time as the smaller batches are safer and more stable.

Conclusion:

The 10001 error code in Salesforce may seem confusing in the beginning, but it is actually Salesforce’s way of protecting system performance. The key thing to remember is that salesforce is built for bulk processing.If your code or automation is not optimized for large amounts of data, governor limits will eventually appear. The best way to avoid the Too Many DML Rows: 10001 error is to:

  • Write bulkified code
  • Avoid DML inside loops
  • Optimize flows
  • Use Batch Apex for large data
  • Prevent recursive automation
  • Test with real-world data volumes

Once you follow these best practices, your Salesforce org becomes faster, safer, and much more scalable. And most importantly, you stop seeing the frustrating “System Limit Exception Too many DML rows: 10001” error again and again.

Get the latest tips, news, updates, advice, inspiration, and more….

Need help fixing this in your org?

Our Salesofrce experts can debug and resolve this issue quickly.