Last active
November 25, 2019 15:54
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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