Skip to content

Instantly share code, notes, and snippets.

Created December 17, 2017 23:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/36e124b2d385a16876b1d2c0f0f622aa to your computer and use it in GitHub Desktop.
Save anonymous/36e124b2d385a16876b1d2c0f0f622aa to your computer and use it in GitHub Desktop.
public without sharing class dailyLimitsController {
public String nowTime {get;set;}
public Integer dailyAPIMax {get;set;}
public Integer dailyAPIRem {get;set;}
public Integer oDataMax {get;set;}
public Integer oDataRem {get;set;}
public Integer wfMax {get;set;}
public Integer wfRem {get;set;}
public Integer wfeMax {get;set;}
public Integer wfeRem {get;set;}
public Integer singleMax {get;set;}
public Integer singleRem {get;set;}
public Integer asyncMax {get;set;}
public Integer asyncRem {get;set;}
public dailyLimitsController(){
Limits__c wfemail = Limits__c.getInstance('DailyWorkflowEmails');
wfeMax = Integer.valueOf(wfemail.Max__c);
wfeRem = Integer.valueOf(wfemail.Remaining__c);
Limits__c dailyAPI = Limits__c.getInstance('DailyApiRequests');
dailyAPIMax = Integer.valueOf(dailyAPI.Max__c);
dailyAPIRem = Integer.valueOf(dailyAPI.Remaining__c);
Limits__c oData = Limits__c.getInstance('HourlyODataCallout');
oDataMax = Integer.valueOf(oData.Max__c);
oDataRem = Integer.valueOf(oData.Remaining__c);
Limits__c wfHourly = Limits__c.getInstance('HourlyTimeBasedWorkflow');
wfMax = Integer.valueOf(wfHourly.Max__c);
wfRem = Integer.valueOf(wfHourly.Remaining__c);
Limits__c singleEmail = Limits__c.getInstance('SingleEmail');
singleMax = Integer.valueOf(singleEmail.Max__c);
singleRem = Integer.valueOf(singleEmail.Remaining__c);
Limits__c async = Limits__c.getInstance('DailyAsyncApexExecutions');
asyncMax = Integer.valueOf(async.Max__c);
asyncRem = Integer.valueOf(async.Remaining__c);
nowTime = async.LastModifiedDate.format('MM/dd/yyyy HH:mm:ss a');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment