Salesforce Developer Limits and Allocations Quick Reference
Salesforce Developer Limits and Allocations Quick Reference
Total stack depth for any Apex invocation that recursively fires triggers 16
due to insert, update, or delete statements3
Maximum cumulative timeout for all callouts (HTTP requests or Web 120 seconds
services calls) in a transaction
Maximum number of push notifications that can be sent in each push 2,000
notification method call
2
Salesforce Developer Limits and Allocations Quick Reference Apex Governor Limits
more than 100 queries. The cumulative limit doesn’t affect limits that are shared across all namespaces,
such as the limit on maximum CPU time.
Note: These cross-namespace limits apply only to namespaces in certified managed packages.
Namespaces in packages that are not certified don’t have their own separate governor limits. The
resources they use continue to count against the same governor limits used by your org's custom
code.
This table lists the cumulative cross-namespace limits.
Description Cumulative
Cross-Namespace
Limit
Total number of SOQL queries issued 1,100
Total number of callouts (HTTP requests or Web services calls) in a transaction 1,100
Description Limit
The maximum number of asynchronous Apex method executions (batch 250,000 or the number
Apex, future methods, Queueable Apex, and scheduled Apex) per a 24-hour of user licenses in your
period1 org multiplied by 200,
whichever is greater
Maximum number of batch Apex jobs in the Apex flex queue that are in 100
Holding status
Maximum number of test classes that can be queued per 24-hour period The greater of 500 or 10
(production orgs other than Developer Edition)5 multiplied by the
3
Salesforce Developer Limits and Allocations Quick Reference Apex Governor Limits
Description Limit
number of test classes in
the org
Maximum number of test classes that can be queued per 24-hour period The greater of 500 or 20
(sandbox and Developer Edition orgs)5 multiplied by the
number of test classes in
the org
Maximum number of query cursors open concurrently per user for the Batch 15
Apex start method
Maximum number of query cursors open concurrently per user for the Batch 5
Apex execute and finish methods
Maximum size of callout request or response (HTTP request or Web services 6 MB for synchronous
call)1 Apex or 12 MB for
asynchronous Apex
Maximum SOQL query run time before Salesforce cancels the transaction 120 seconds
Maximum number of class and trigger code units in a deployment of Apex 5,000
Description Limit
Maximum number of characters for a class 1 million
4
Salesforce Developer Limits and Allocations Quick Reference API Request Limits and Allocations
The following table lists the allocations for the total API requests (calls) per 24-hour period for an org.
Salesforce Edition API Calls Per License Type Total Calls Per 24-Hour
Period
Developer Edition N/A 15,000
5
Salesforce Developer Limits and Allocations Quick Reference API Request Limits and Allocations
Salesforce Edition API Calls Per License Type Total Calls Per 24-Hour
Period
• Employee Apps Starter: 1000
per member for Enterprise
Edition orgs
• Employee Apps Plus: 1000 per
member for Enterprise Edition
orgs
6
Salesforce Developer Limits and Allocations Quick Reference Chatter REST API Limits
Note: Load, performance, and other system issues can prevent some limits from being reached.
Limits can change without notice. Applications should make efficient use of available requests and
gracefully handle the 503 error code.
Batch lifespan Batches and jobs that are older than seven days are removed from the
queue regardless of job status. The seven days are measured from the
youngest batch associated with a job, or the age of the job if there are
no batches. You can’t create batches associated with a job that is more
than 24 hours old.
Batch size • Batches for data loads can consist of a single CSV, XML, or JSON
file that is no larger than 10 MB.
• A batch can contain a maximum of 10,000 records.
• A batch can contain a maximum of 10,000,000 characters for all
the data in a batch.
• A field can contain a maximum of 32,000 characters.
• A record can contain a maximum of 5,000 fields.
• A record can contain a maximum of 400,000 characters for all its
fields.
• A batch must contain some content or an error occurs.
Batch processing time Batches are processed in chunks. The chunk size depends on the API
version. In API version 20.0 and earlier, the chunk size is 100 records.
In API version 21.0 and later, the chunk size is 200 records. There’s a
5-minute limit for processing each chunk. Also, if it takes longer than
10 minutes to process a whole batch, the Bulk API places the remainder
of the batch back in the queue for later processing. If the Bulk API
7
Salesforce Developer Limits and Allocations Quick Reference API Query Cursor Limits
Binary content • The length of any file name can’t exceed 512 bytes.
• A zip file can’t exceed 10 MB.
• The total size of the unzipped content can’t exceed 20 MB.
• A maximum of 1,000 files can be contained in a zip file. Directories
don’t count toward this total.
Bulk query number of attempts 15 attempts at 10 minutes each to process the batch. There is also a
to query 2-minute limit on the time to process the query. If more than 15
attempts are made for the query, an error message of “Tried more than
fifteen times” is returned. If the query takes more than 2 minutes to
process, a QUERY_TIMEOUT error is returned.
Bulk query number of retrieved 15 files. If the query needs to return more than 15 files, add filters to
files the query to return less data. Bulk batch sizes are not used for bulk
queries.
Job open time The maximum time that a job can remain open is 24 hours. The Bulk
API doesn't support clients that, for example, post one batch every
hour for many hours.
8
Salesforce Developer Limits and Allocations Quick Reference SOAP API Call Limits
getDeleted() Limits for • If your getDeleted() call returns more than 600,000
returned records and the user is a system administrator, an
records exception EXCEEDED_ID_LIMIT is returned.
• If your getDeleted() call returns more than 20,000
records and the user is not a system administrator, an
exception OPERATION_TOO_LARGE is returned. Note that
this error is returned when more than 20,000 records
across the organization have been deleted, not just the
records viewable by the user.
login() Maximum calls The limit is 3600 calls to login() per user per hour.
per user Exceeding this limit results in a “Login Rate Exceeded” error.
merge() Merge request • Up to 200 merge requests can be made in a single SOAP
limits call.
• Up to three records can be merged in a single request,
including the master record. This limit is the same as the
limit enforced by the Salesforce user interface. To merge
more than 3 records, do a successive merge.
• External ID fields cannot be used with merge().
query() and Batch size WSC clients can set the batch size by calling
queryMore() limits setQueryOptions() on the connection object. C# client
applications can change this setting by specifying the batch
size in the call QueryOptions portion of the SOAP header
before invoking the query() call. The maximum batch size
is 2,000 records. However this setting is only a suggestion.
There is no guarantee that the requested batch size will be
the actual batch size. This is done to maximize performance.
The batch size will be no more than 200 if the SOQL statement
selects two or more custom fields of type long text. This is to
prevent large SOAP messages from being returned.
9
Salesforce Developer Limits and Allocations Quick Reference Metadata Limits
Metadata Limits
The following limits apply to the Force.com IDE, the Ant Migration Tool, and the Metadata API.
Limit Description
Retrieving and You can deploy or retrieve up to 10,000 files at once and the maximum size
deploying metadata of the deployed or retrieved .zip file is 39 MB. Note the following:
• If using the Ant Migration Tool to deploy an unzipped folder, all files in
the folder are compressed first. The maximum size of uncompressed
components in an unzipped folder is 400 MB or less depending on the
compression ratio. If the files have a high compression ratio, you can
migrate a total of approximately 400 MB because the compressed size
would be under 39 MB. However, if the components can't be compressed
much, like binary static resources, you can migrate less than 400 MB.
• Metadata API base-64 encodes components after they’re compressed.
The resulting .zip file can't exceed 50 MB, which is the limit for SOAP
messages. Base-64 encoding increases the size of the payload, so your
compressed payload can't exceed approximately 39 MB before encoding.
Change sets Inbound and outbound change sets can have up to 10,000 files of metadata.
SOSL statements Maximum length of By default, 20,000 characters. This limit is tied to the SOQL
SOSL statements statement character limit defined for your org.
SOSL search query Maximum length of If the SearchQuery string is longer than 10,000
strings SearchQuery characters, no result rows are returned. If
string SearchQuery is longer than 4,000 characters, any
logical operators are removed. For example, the AND
10
Salesforce Developer Limits and Allocations Quick Reference Visualforce Limits
SOSL query results Maximum rows 2,000 results total (API version 28.0 and later), unless you
returned specify custom limits in the query. Previous API versions
return 200 results.
FOR VIEW and FOR Maximum The RecentlyViewed object is updated every time the
REFERENCE RecentlyViewed records logged-in user views or references a record. It is also
allowed updated when records are retrieved using the FOR
VIEW or FOR REFERENCE clause in a SOQL query.
To ensure that the most recent data is available,
RecentlyViewed data is periodically truncated down to
200 records per object. RecentlyViewed data is retained
for 90 days, after which it is removed on a periodic basis.
OFFSET clause Maximum number of The maximum offset is 2,000 rows. Requesting an offset
rows skipped by greater than 2,000 results in a
OFFSET NUMBER_OUTSIDE_VALID_RANGE error.
Visualforce Limits
Limit Value
Maximum response size for a Visualforce page Less than 15 MB
11
Salesforce Developer Limits and Allocations Quick Reference Visualforce Limits
Limit Value
Maximum view state size in a Visualforce page 135 KB
Maximum size of HTML response before rendering, when Visualforce page Less than 15 MB
is rendered as PDF
Maximum rows retrieved by queries for a single Visualforce page request 50,000
Maximum rows retrieved by queries for a single Visualforce page request 1,000,000
in read-only mode
12