Skip to content

Instantly share code, notes, and snippets.

Created Dec 17, 2017
What would you like to do?
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