Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
OrgLimit Class
Namespace
Usage
Use the System.OrgLimits getAll and getMap methods to obtain either a list or a map of all your org limits. To get details on each limit, use instance methods from System.OrgLimit.
For comparison, the Limits Class returns Apex governor limits and not Salesforce API limits.
OrgLimit Methods
The following are methods for OrgLimit.
getLimit()
Signature
public Integer getLimit()
Return Value
Type: Integer
Example
1List<System.OrgLimit> limits = OrgLimits.getAll();
2for (System.OrgLimit aLimit: limits) {
3 System.debug('Limit: ' + aLimit.getName());
4 System.debug('Max Limit is: ' + aLimit.getLimit());
5}getName()
Signature
public String getName()
Return Value
Type: String
Example
1List<System.OrgLimit> limits = OrgLimits.getAll();
2for (System.OrgLimit aLimit: limits) {
3 System.debug('Limit: ' + aLimit.getName());
4 System.debug('Max Limit is: ' + aLimit.getLimit());
5}getValue()
Signature
public Integer getValue()
Return Value
Type: Integer
Example
1List<System.OrgLimit> limits = OrgLimits.getAll();
2for (System.OrgLimit aLimit: limits) {
3 System.debug('Limit: ' + aLimit.getName());
4 System.debug('Usage Value is: ' + aLimit.getValue());
5}toString()
Signature
public String toString()
Return Value
Type: String
1OrgLimit[DailyBulkApiBatches: consumed 25 of 15000]