salesforce logo

If you are looking for salesforce consulting services then

Contact here

Governor Limits in Salesforce

Since Salesforce keeps running on the multi-tenure condition and so as to have a similar presentation to the database, it has forced some runtime limits called governor limits. Governor limits are runtime limits authorized by the Apex runtime engine to guarantee that code doesn't get out of hand. Governor limits are Salesforce's method for compelling you to compose effectively, versatile code. Salesforce Governor limits counteract different organizations from reviewing terrible code and taking all the cloud CPU. Coding limits when all is said in done are totally novel to Apex – think of it as professional stability!

Governor Limits are calculated by a number of factors that determine what limit is used, and when it is applied based on the Invocation of Apex-Entry, No.of Records, Which limit to use.

There are different kinds of Governor limits like

  • Execution Governors and Limits.
  • Apex Governor Limits.
  • SOQL and SOSL Character Limits.

There are numerous sorts of Salesforce Governor limits like Pre-exchange limits, Force.com platform peak limits, static apex limits and the number of different limits.

Execution of Apex Governor Limits

These limits count each Apex transactions, these limits are reset for each execution of a batch of records in the execute method.

This table lists limits that apply for both synchronous and asynchronous apex,

Description 

Synchronous Limit

Asynchronous Limit

Total number of SOQL queries issued by the salesforce

100

200

Total number of records retrieved by SOQL queries in salesforce apex

50,000

 

Number of records retrieved by Database.getQueryLocator

10,000

 

Total number of SOSL queries issued by salesforce

20

 

Number of records retrieved by a single SOSL query in salesforce

2,000

 

Total DML statements issued in salesforce apex

150

 

The number of records processed as a result of DML statements like Approval.process, or Database.emptyRecycleBin

10,000

 

Stack profundity for any Apex conjuring that recursively flames triggers because of insert, update or delete statements

16

 

Number of callouts or HTTP requests or service calls in a transaction

100

 

Maximum methods with future annotation allow per Apex invocation

50

0 in batch and 1 in queueable context

Maximum cumulative timeout for all callouts per transaction

120 seconds

 

SendEmail methods allowed in salesforce

10

 

Maximum Apex jobs added to the queue with System.enqueueJob in salesforce

50

1

Total Heap size in salesforce

6MB

12MB

Maximum CPU Time consumed on the Salesforce server

10,000

 milliseconds

60,000

milliseconds

Maximum execution time for each Apex transaction

10 minutes

 

Maximum push notification method calls allowed per Apex transaction

10

 

Maximum push notifications that can be sent to each push notification method calls

2,000

 
 

SOQL and SOSL Limits

Salesforce Object Query Language is used to read information stored in your org database. SOQL query in Apex code or in the Developer Consoles Query Editor. Salesforce Object Search Language is a salesforce search language which is used to perform text searches in records, Mainly SOSL is used to search fields across multiple standard and custom object records in salesforce.

Feature

Limit

Limit Description

SOQL statements

The maximum length of SOQL statements

20.000 characters

SOQL WHERE clause

The maximum length of SOQL WHERE clause

4,000 characters

SOSL statements

The maximum length of SOSL statements

20,000 characters, This limit is tied to the SOQL statement character limit defined for your org.

SOQL search query strings

The maximum length of the SearchQuery string

If SearchQuery>10,000 characters then result rows are not returned. If SearchQuery>4,000 characters then logical operations are removed.

SOSL query results

Maximum rows returned

2,000 results, by custom limits otherwise it returns 200 results

Relationship Queries

Relationship query limits

More than 35 child-parent relationships are not specified in the query, custom object which allows 25 relationships which are referred.

FOR VIEW

 And

 FOR REFERENCE

Maximum RecentlyViewed records allowed

Recently viewed data on a periodic basis is 200 records. It is updated when records are retrieved using the FOR VIEW or FOR REFERENCE clause in a SOQL

OFFSET clause

Maximum number of rows skipped by OFFSET

The maximum offset is 2,000 rows. If we want more  OFFSET it results in a NUMBER_OUTSIDE_VALID_RANGE error

About Micropyramid

Micropyramid is a software development and cloud consulting partner for enterprise businesses across the world. We work on python, Django, Salesforce, Angular, Reactjs, React Native, MySQL, PostgreSQL, Docker, Linux, Ansible, git, amazon web services. We are Amazon and salesforce consulting partner with 5 years of cloud architect experience. We develop e-commerce, retail, banking, machine learning, CMS, CRM web and mobile applications.


Posted On 22 November 2019 By MicroPyramid


Need any Help in your Project?Let's Talk

Latest Comments

Subscribe To our news letter

Subscribe and Stay Updated about our Webinars, news and articles on Django, Python, Machine Learning, Amazon Web Services, DevOps, Salesforce, ReactJS, AngularJS, React Native.
* We don't provide your email contact details to any third parties