Created
March 22, 2019 00:55
-
-
Save bobbyjam99-zz/c48f6821d14f30285803b3cc1a698bca to your computer and use it in GitHub Desktop.
OrgLimit クラス 使用サンプル
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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