List<System.OrgLimit> lstOrgLimits = OrgLimits.getAll();
for (System.OrgLimit objLimit : lstOrgLimits) {
System.debug('Limit : ' + objLimit.getName());
System.debug('Current Limit: ' + objLimit.getValue());
System.debug('Max Limit : ' + objLimit.getLimit());
}
Output:
To get specific limit, for example file storage limit use the below code
System.OrgLimit objLimit = OrgLimits.getMap().get('FileStorageMB');
System.debug('Limit : ' + objLimit.getName());
System.debug('Current Limit: ' + objLimit.getValue());
System.debug('Max Limit : ' + objLimit.getLimit());
Output:
No comments:
Post a Comment