Salesforce Governor Limits

What Are Salesforce Governor Limits

Salesforce ensures the effective use of resources on a multi-tenant platform that is through Salesforce Governor Limits. Salesforce has set certain limits for the effective execution of the code.

The governor limits have been imposed to ensure that resources are not acquired by users other than authenticated ones. Since by Salesforce is multi-tenants that means that all customers share a single resource. So it’s mandatory to implement certain restrictions to avoid code misuse.

Types of Salesforce Governor Limits

There are various types of Salesforce governor limits for different security levels and other metrics related to code.

These types are listed below:

Per-transaction Certified Managed Package Limits

This type is relevant when the AppExchange checks have been cleared for the majority of transaction limits. The Certified Managed Package is developed by ISV partners and installation is done from AppExchange with a unique namespace. Other details include :

Total SOQL queries issued1100
Total retrieved records by Database.getQueryLocator110000
Number of SOSL queries issued220
Total DML statements issued1650
Total Callouts in a transaction1100
Toal sendEmail methods allowed110

dont miss out iconDon't forget to check out: Apex Integration in Salesforce - The Developer Guide

Static Apex Limits

The governor limits by Salesforce has different limits for each Apex description. The limits included in static apex comprise different types of callouts, loops, queries, batch sizes, and transactions. The limit details for each type are mentioned below :

The default timeout for transaction callouts10 seconds
Max. size of callout request or response6MB (Synchronous)
12 MB ( Asynchronous)
SOQL query runtime before cancellation of a transaction120 seconds
Max. number of class and trigger units of code5000
Trigger batch size for Apex200
Size of loop list batch200
Batch Apex query returned records in Database.QueryLocator50 million

Per-transaction Apex Limits

These limitations are designed for counting all Apex transactions. The limits for both synchronous and asynchronous Apex are mentioned below:

FactorSynchronous LimitAsynchronous Limit
Total SOQL queries issued100200
Total records retrieved by SOQL queries50,000
Total records retrieved by Database.getQueryLocator10,000
Total SOSL queries issued20
Records retrieved by a single SOSL query20,000
Toal DML statements issued150
Total records processed by DML statements10,000
Stack depth for Apex invocation16
Total callots in a transaction100
Methods allowed per Apex invocation500 in batch & future contexts, 1 in queueable context
Number of Apex jobs added501
Toal sendEmail methods allowed10
Total heap size6 MB12 MB
Max. CPU time on Salesforce servers10,000 milliseconds60,000 milliseconds
Execution time for Apex transaction10 minutes
Max. push notifications per Apex transaction10
Max push notifications send through each push notification method call2000

dont miss out iconCheck out another amazing blog by SP Tech here: How Salesforce CRM better than other CRM?

Lightning Platform Apex Limits

The lightning platform is responsible for the handling of the following limits:

The maximum amount of asynchronous method executions per day25,000
Parallelly scheduled apex classes100
Queued Apex jobs5
Max. batches submitted5
Parallelly opened query cursors/user50
Parallelly opened query cursors/user15

Size-specific Apex Limits

This type serves the purpose of keeping a check on outsized items in classes. The limitations for size-specific elements include:

The maximum amount of characters/ class1 mn
The maximum amount of triggers/ class1 Million
Apex maximum code utilization6 MB
Limit for method size65,535

Reference: SP Tech


Popular Salesforce Blogs