Play Games

Search This Blog

Saturday, May 28, 2022

System.LimitException: Too many query rows: 50001 in salesforce - Salesforce Globe For You

System.LimitException: Too many query rows: 50001 in salesforce - Salesforce Globe For You

Answer: For each Apex transaction,total number of records retrieved by SOQL queries whether synchronous or asynchronous is 50000.

If single or multiple soql queries are running in a single transaction and the total sum of records returned 

by all queries in that single apex transaction exceeds 50000,then this error occurs.

Solution

1)Use conditions in soql queries if possible to filter the records.

2) Use Batch Apex.

No comments:

Post a Comment