Skip to content

Instantly share code, notes, and snippets.

@dancinllama
Last active November 25, 2019 15:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dancinllama/6581945 to your computer and use it in GitHub Desktop.
Save dancinllama/6581945 to your computer and use it in GitHub Desktop.
Using Kevin 080's trigger handler setup for kicking off batch jobs based on data load
protected override void afterInsert() {
boolean isSuccessfulRun = false;
for(Integer i=0; i < Trigger.new.size() && isSuccessful == false; i++){
isSuccessfulRun |= (((DL__c)Trigger.new.get(i)).Status__c == 'Completed');
}
if(isSuccessfulRun){
//Kick off batch jobs
Database.executeBatch(new MyNotSoFirstBatchJob(),50);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment