Skip to content

Instantly share code, notes, and snippets.

@bobbyjam99-zz
Created March 22, 2019 00:55
Show Gist options
  • Save bobbyjam99-zz/c48f6821d14f30285803b3cc1a698bca to your computer and use it in GitHub Desktop.
Save bobbyjam99-zz/c48f6821d14f30285803b3cc1a698bca to your computer and use it in GitHub Desktop.
OrgLimit クラス 使用サンプル
/**
* https://developer.salesforce.com/docs/atlas.ja-jp.apexcode.meta/apexcode/apex_class_System_OrgLimit.htm
*/
List<System.OrgLimit> limits = OrgLimits.getAll();
for (System.OrgLimit aLimit: limits) {
System.debug('Limit: ' + aLimit.getName());
System.debug('Usage Value is: ' + aLimit.getValue());
System.debug('Max Limit is: ' + aLimit.getLimit());
}
System.debug('**************');
Map<String,System.OrgLimit> limitsMap = OrgLimits.getMap();
System.OrgLimit apiRequestsLimit = limitsMap.get('DailyApiRequests');
System.debug('Limit Name: ' + apiRequestsLimit.getName());
System.debug('Usage Value: ' + apiRequestsLimit.getValue());
System.debug('Maximum Limit: ' + apiRequestsLimit.getLimit());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment