Skip to content

Instantly share code, notes, and snippets.

@agentgill
Created September 7, 2020 06:34
Show Gist options
  • Select an option

  • Save agentgill/a6a694408793ebb1697e760850cfb1d3 to your computer and use it in GitHub Desktop.

Select an option

Save agentgill/a6a694408793ebb1697e760850cfb1d3 to your computer and use it in GitHub Desktop.
/**
@description - Universal Batch Apex Scheduler
@credit - https://th3silverlining.com/2014/02/02/salesforce-universal-batch-scheduling-class/
*/
global class BatchScheduler implements Schedulable {
global Database.Batchable<SObject> batchClass{get;set;}
global Integer batchSize{get;set;} {batchSize = 200;}
global void execute(SchedulableContext sc) {
database.executebatch(batchClass, batchSize);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment