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.
OrgLimits 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.
OrgLimits Methods
The following are methods for OrgLimits.
getAll()
Signature
public static List<System.OrgLimit> getAll()
Return Value
Type: List<System.OrgLimit>
getMap()
Signature
public static Map<String,System.OrgLimit> getMap()
Return Value
Type: Map<String,System.OrgLimit>
Example
1Map<String,System.OrgLimit> limitsMap = OrgLimits.getMap();
2System.OrgLimit apiRequestsLimit = limitsMap.get('DailyApiRequests');
3System.debug('Limit Name: ' + apiRequestsLimit.getName());
4System.debug('Usage Value: ' + apiRequestsLimit.getValue());
5System.debug('Maximum Limit: ' + apiRequestsLimit.getLimit());