Loading

Exceeded Execution Governors Limit - Error: System.LimitException: Too many SOQL queries: 101

Дата публикации: Jun 18, 2024
Описание

The following error appears when you exceed the Execution Governors Limit (you can run up to a total 100 SOQL queries in a single call or context). 

System.LimitException: Too many SOQL queries: 101 error


Notes:

  • All the SOQL queries in triggers fired from one call or context will be counted against the limit of 100.
  • Salesforce cannot disable or raise the Governors Limit.
Решение


Resolve the "Too many SOQL queries: 101" error

To fix the issue, change your code so that the number of SOQL fired is less than 100.

If you need to change the context, you can use @future annotation which will run the code asynchronously.
 

Best practices to avoid exceeding the Governors Limit

Since Apex runs on a multi-tenant platform, the Apex runtime engine strictly enforces limits to ensure code doesn't monopolize shared resources.
 

Дополнительные ресурсы

Troubleshoot Flow Errors

Considerations for Troubleshooting Flows

Номер статьи базы знаний

000386220

 
Загрузка
Salesforce Help | Article