---
title: "E2120 Too many query rows"
description: "E2120 Too many query rows"
keywords: "E2120 Too many query rows Cannot insert update activate entity"
url: "https://myrapidi.com/wiki/e2120_too_many_query_rows"
locale: "en"
published: "2025-03-13T12:59:22Z"
modified: "2025-03-13T12:59:22Z"
---

When "Too many query rows: 50001" and "CANNOT\_INSERT\_UPDATE\_ACTIVATE\_ENTITY" appear together, it means that an insert or update operation is failing due to a trigger or automation exceeding the SOQL query row limit (50,000 records).  
  
**E2120 - ECE\_SForceUpdateInsert: We got an error back from SalesForce when trying to update or insert data in SalesForce.  
Error returned from SFDC on upsert: [message: SalesOrderLineTrigger: System.LimitException: Too many query rows: 50001 , statusCode: CANNOT\_INSERT\_UPDATE\_ACTIVATE\_ENTITY] , Record does not exist in SFDC, Data sent to SFDC: sObjects: [type: SalesLine\_\_c , Unique\_Key\_\_c: 0#SO-013018#40000 , Name: 00040000 , No\_\_c: LT , Description\_\_c: Production only.**  
  
**What is happening in Salesforce?**  
  
**A record (or multiple records) is being inserted or updated.**

- This is usually through an API call in Salesforce.

**A trigger, Process Builder, or Flow runs as part of this insert/update.**

- The automation contains SOQL queries.

**The SOQL query inside the automation retrieves more than 50,000 records.**

- Salesforce enforces a governor limit that prevents a **single transaction** from querying more than 50,000 rows.

**Salesforce throws "Too many query rows: 50001".**

- Because this happens **inside a trigger or automation** , the insert/update cannot proceed.

**The error "CANNOT\_INSERT\_UPDATE\_ACTIVATE\_ENTITY" is thrown.**

- This tells you that the failure happened due to a **trigger, Process Builder, or Flow** that was supposed to run during the record update.

**Solution** :

- **Add Selective Filtering to SOQL :** Instead of querying **all** records, only query the **needed ones**.This ensures only the required records are queried, avoiding the 50,000 row limit.
