1. 程式人生 > >salesforce 日常筆記----limit 包括常用 limit方法

salesforce 日常筆記----limit 包括常用 limit方法

day 2017/12 /4

Limits Methods

    The following are methods for Limits. All methods are static.
 

 

Description Synchronous Limit Asynchronous Limit
Total number of SOQL queries issued1 100 200
Total number of records retrieved by SOQL queries 50,000
Total number of records retrieved by Database.getQueryLocator 10,000
Total number of SOSL queries issued 20
Total number of records retrieved by a single SOSL query 2,000
Total number of DML statements issued2 150
Total number of records processed as a result of DML statements, Approval.process, or database.emptyRecycleBin
10,000
Total stack depth for any Apex invocation that recursively fires triggers due to insert, update, or delete statements3 16
Total number of callouts (HTTP requests or Web services calls) in a transaction
100
Maximum cumulative timeout for all callouts (HTTP requests or Web services calls) in a transaction 120 seconds
Maximum number of methods with the future annotation allowed per Apex invocation 50
Maximum number of Apex jobs added to the queue with System.enqueueJob 50
Total number of sendEmail methods allowed 10
Total heap size4 6 MB 12 MB
Maximum CPU time on the Salesforce servers5 10,000 milliseconds 60,000 milliseconds
Maximum execution time for each Apex transaction 10 minutes
Maximum number of push notification method calls allowed per Apex transaction 10
Maximum number of push notifications that can be sent in each push notification method call 2,000

 

IN THIS SECTION:

getAggregateQueries()

Returns the number of aggregate queries that have been processedwith any SOQL query statement.

getLimitAggregateQueries()

Returns the total number of aggregate queries that can beprocessed with SOQL query statements.

getAsyncCalls()

Reserved for future use.

getLimitAsyncCalls()

Reserved for future use.

getCallouts()

Returns the number of Web service statements that have beenprocessed.

getChildRelationshipsDescribes()

Deprecated. Returns the number of child relationship objects thathave been returned.

getLimitCallouts()

Returns the total number of Web service statements that can beprocessed.

getCpuTime()

Returns the CPU time (in milliseconds) accumulated on theSalesforce servers in the current transaction.

getLimitCpuTime()

Returns the time limit (in milliseconds) of CPU usage in thecurrent transaction.

getDMLRows()

Returns the number of records that have been processed with anystatement that counts against DML limits, such as DML statements,

the Database.emptyRecycleBin method, and other methods.

getLimitDMLRows()

Returns the total number of records that can be processed with anystatement that counts against DML limits, such as DML statements,

the database.EmptyRecycleBin method, and other methods.

getDMLStatements()

Returns the number of DML statements (such as insertupdate or the database.EmptyRecycleBin method) that

have been called.

getLimitDMLStatements()

Returns the total number of DML statements or the database.EmptyRecycleBin methods that can be called.

getEmailInvocations()

Returns the number of email invocations (such as sendEmail) that have been called.

getLimitEmailInvocations()

Returns the total number of email invocation (such as sendEmail) that can be called.

getFindSimilarCalls()

Deprecated. Returns the same value as getSoslQueries. The number of findSimilar methods is no longer a separate

limit, but is tracked as the number of SOSL queries issued.

getLimitFindSimilarCalls()

Deprecated. Returns the same value as getLimitSoslQueries. The number of findSimilar methods is no longer a

separate limit, but is tracked as the number of SOSL queriesissued.

getFutureCalls()

Returns the number of methods with the future annotation that have been executed (notnecessarily completed).

getLimitFutureCalls()

Returns the total number of methods with the future annotation that can be executed (notnecessarily completed).

getHeapSize()

Returns the approximate amount of memory (in bytes) that has beenused for the heap.

getLimitHeapSize()

Returns the total amount of memory (in bytes) that can be used forthe heap.

getMobilePushApexCalls()

Returns the number of Apex calls that have been used by mobilepush notifications during the current metering interval.

getLimitMobilePushApexCalls()

Returns the total number of Apex calls that are allowed pertransaction for mobile push notifications.

getQueries()

Returns the number of SOQL queries that have been issued.

getLimitQueries()

Returns the total number of SOQL queries that can be issued.

getQueryLocatorRows()

Returns the number of records that have been returned by the Database.getQueryLocator method.

getLimitQueryLocatorRows()

Returns the total number of records that have been returned by theDatabase.getQueryLocatormethod.

getQueryRows()

Returns the number of records that have been returned by issuingSOQL queries.

getLimitQueryRows()

Returns the total number of records that can be returned byissuing SOQL queries.

getQueueableJobs()

Returns the number of queueable jobs that have been added to thequeue per transaction. A queueable job corresponds to a class

that implements the Queueable interface.

getLimitQueueableJobs()

Returns the maximum number of queueable jobs that can be added tothe queue per transaction. A queueable job corresponds to

a class that implements the Queueable interface.

getRunAs()

Deprecated. Returns the same value as getDMLStatements.

getLimitRunAs()

Deprecated. Returns the same value as getLimitDMLStatements.

getSavepointRollbacks()

Deprecated. Returns the same value as getDMLStatements.

getLimitSavepointRollbacks()

Deprecated. Returns the same value as getLimitDMLStatements.

getSavepoints()

Deprecated. Returns the same value as getDMLStatements.

getLimitSavepoints()

Deprecated. Returns the same value as getLimitDMLStatements.

getSoslQueries()

Returns the number of SOSL queries that have been issued.

getLimitSoslQueries()

Returnsthe total number of SOSL queries that can be issued.

 

 

 

getAggregateQueries()

Returns the number of aggregate queries that have been processedwith any SOQL query statement.

Signature

public static Integer getAggregateQueries()

ReturnValue

Type: Integer

getLimitAggregateQueries()

Returns the total number of aggregate queries that can beprocessed with SOQL query statements.

Signature

public static Integer getLimitAggregateQueries()

ReturnValue

Type: Integer

getAsyncCalls()

Reserved for future use.

Signature

public static Integer getAsyncCalls()

ReturnValue

Type: Integer

getLimitAsyncCalls()

Reserved for future use.

Signature

public static Integer getLimitAsyncCalls()

ReturnValue

Type: Integer

getCallouts()

Returns the number of Web service statements that have beenprocessed.

Signature

public static Integer getCallouts()

ReturnValue

Type:Integer

getChildRelationshipsDescribes()

Deprecated. Returns the number of child relationship objects thathave been returned.

Signature

public static Integer getChildRelationshipsDescribes()

ReturnValue

Type: Integer

Usage

Note: Because describe limitsare no longer enforced in any API version, this method is no longer available.In API version 30.0

and earlier, this method is available but is deprecated.

getLimitCallouts()

Returns the total number of Web service statements that can beprocessed.

Signature

public static Integer getLimitCallouts()

ReturnValue

Type: Integer

getCpuTime()

Returns the CPU time (in milliseconds) accumulated on theSalesforce servers in the current transaction.

Signature

public static Integer getCpuTime()

ReturnValue

Type: Integer

getLimitCpuTime()

Returns the time limit (in milliseconds) of CPU usage in thecurrent transaction.

Signature

public static Integer getLimitCpuTime()

ReturnValue

Type:Integer

getDMLRows()

Returns the number of records that have been processed with anystatement that counts against DML limits, such as DML statements,

the Database.emptyRecycleBin method, and other methods.

Signature

public static Integer getDMLRows()

ReturnValue

Type: Integer

getLimitDMLRows()

Returns the total number of records that can be processed with anystatement that counts against DML limits, such as DML statements,

the database.EmptyRecycleBin method, and other methods.

Signature

public static Integer getLimitDMLRows()

ReturnValue

Type: Integer

getDMLStatements()

Returns the number of DML statements (such as insertupdate or the database.EmptyRecycleBin method) that have

been called.

Signature

public static Integer getDMLStatements()

ReturnValue

Type: Integer

getLimitDMLStatements()

Returns the total number of DML statements or the database.EmptyRecycleBin methods that can be called.

Signature

public static Integer getLimitDMLStatements()

ReturnValue

Type:Integer

getEmailInvocations()

Returns the number of email invocations (such as sendEmail) that have been called.

Signature

public static Integer getEmailInvocations()

ReturnValue

Type: Integer

getLimitEmailInvocations()

Returns the total number of email invocation (such as sendEmail) that can be called.

Signature

public static Integer getLimitEmailInvocations()

ReturnValue

Type: Integer

getFindSimilarCalls()

Deprecated. Returns the same value as getSoslQueries. The number of findSimilar methods is no longer a separate limit,

but is tracked as the number of SOSL queries issued.

Signature

public static Integer getFindSimilarCalls()

ReturnValue

Type: Integer

getLimitFindSimilarCalls()

Deprecated. Returns the same value as getLimitSoslQueries. The number of findSimilar methods is no longer a separate

limit, but is tracked as the number of SOSL queries issued.

Signature

public static Integer getLimitFindSimilarCalls()

ReturnValue

Type:Integer

getFutureCalls()

Returns the number of methods with the future annotation that have been executed (notnecessarily completed).

Signature

public static Integer getFutureCalls()

ReturnValue

Type: Integer

getLimitFutureCalls()

Returns the total number of methods with the future annotation that can be executed (notnecessarily completed).

Signature

public static Integer getLimitFutureCalls()

ReturnValue

Type: Integer

getHeapSize()

Returns the approximate amount of memory (in bytes) that has beenused for the heap.

Signature

public static Integer getHeapSize()

ReturnValue

Type: Integer

getLimitHeapSize()

Returns the total amount of memory (in bytes) that can be used forthe heap.

Signature

public static Integer getLimitHeapSize()

ReturnValue

Type: Integer

getMobilePushApexCalls()

Returnsthe number of Apex calls that have been used by mobile push notificationsduring the current metering interval.

Signature

public static Integer getMobilePushApexCalls()

ReturnValue

Type:Integer

getLimitMobilePushApexCalls()

Returns the total number of Apex calls that are allowed pertransaction for mobile push notifications.

Signature

public static Integer getLimitMobilePushApexCalls()

ReturnValue

Type:Integer

getQueries()

Returns the number of SOQL queries that have been issued.

Signature

public static Integer getQueries()

ReturnValue

Type: Integer

getLimitQueries()

Returns the total number of SOQL queries that can be issued.

Signature

public static Integer getLimitQueries()

ReturnValue

Type: Integer

getQueryLocatorRows()

Returns the number of records that have been returned by the Database.getQueryLocator method.

Signature

public static Integer getQueryLocatorRows()

ReturnValue

Type: Integer

getLimitQueryLocatorRows()

Returns the total number of records that have been returned by theDatabase.getQueryLocatormethod.

Signature

public static Integer getLimitQueryLocatorRows()

ReturnValue

Type: Integer

getQueryRows()

Returns the number of records that have been returned by issuingSOQL queries.

Signature

public static Integer getQueryRows()

ReturnValue

Type: Integer

getLimitQueryRows()

Returns the total number of records that can be returned byissuing SOQL queries.

Signature

public static Integer getLimitQueryRows()

ReturnValue

Type: Integer

getQueueableJobs()

Returns the number of queueable jobs that have been added to thequeue per transaction. A queueable job corresponds to a class that

implements the Queueable interface.

Signature

public static Integer getQueueableJobs()

ReturnValue

Type:Integer

getLimitQueueableJobs()

Returns the maximum number of queueable jobs that can be added tothe queue per transaction. A queueable job corresponds to a

class that implements the Queueable interface.

Signature

public static Integer getLimitQueueableJobs()

ReturnValue

Type: Integer

getRunAs()

Deprecated. Returns the same value as getDMLStatements.

Signature

public static Integer getRunAs()

ReturnValue

Type: Integer

Usage

The number of RunAs methods is no longer a separate limit, but is tracked as thenumber of DML statements issued.

getLimitRunAs()

Deprecated. Returns the same value as getLimitDMLStatements.

Signature

public static Integer getLimitRunAs()

ReturnValue

Type: Integer

Usage

The number of RunAs methods is no longer a separate limit, but is tracked as thenumber of DML statements issued.

getSavepointRollbacks()

Deprecated. Returns the same value as getDMLStatements.

Signature

public static Integer getSavepointRollbacks()

ReturnValue

Type: Integer

Usage

The number of Rollback methods is no longer a separate limit, but is tracked as thenumber of DML statements issued.

getLimitSavepointRollbacks()

Deprecated. Returns the same value as getLimitDMLStatements.

Signature

public static Integer getLimitSavepointRollbacks()

ReturnValue

Type: Integer

Usage

The number of Rollback methods is no longer a separate limit, but is tracked as thenumber of DML statements issued.

getSavepoints()

Deprecated. Returns the same value as getDMLStatements.

Signature

public static Integer getSavepoints()

ReturnValue

Type: Integer

Usage

The number of setSavepoint methods is no longer a separate limit, but is tracked as thenumber of DML statements issued.

getLimitSavepoints()

Deprecated. Returns the same value as getLimitDMLStatements.

Signature

public static Integer getLimitSavepoints()

ReturnValue

Type:Integer

Usage

The number of setSavepoint methods is no longer a separate limit, but is tracked as thenumber of DML statements issued.

getSoslQueries()

Returns the number of SOSL queries that have been issued.

Signature

public static Integer getSoslQueries()

ReturnValue

Type: Integer

getLimitSoslQueries()

Returns the total number of SOSL queries that can be issued.

Signature

public static Integer getLimitSoslQueries()

ReturnValue

Type:Integer