I'm looking to pass a variable to my scheulder class when scheduling a batch job. The idea is that I'm scheduling the class multiple times, but passing in a different variable each time.
Example:
String cron = '0 0 0,17 ? * SAT *';
System.schedule('BatchOpportunityOwnerAssignment Daily Package Lead',
cron, new BatchOpportunityOwnerAssignmentScheduler('Package Lead'));
String cron = '0 0 0,18 ? * SAT *';
System.schedule('BatchOpportunityOwnerAssignment Daily Non Package Lead',
cron, new BatchOpportunityOwnerAssignmentScheduler('Non Package Lead'));
Here's what my current class looks like now:
global class BatchOpportunityOwnerAssignmentScheduler implements Schedulable {
global void execute( SchedulableContext sc ) {
BatchOpportunityOwnerAssignment apBatch = new
BatchOpportunityOwnerAssignment(VARIABLE HERE);
database.executebatch(apBatch,50);
}
}
Thoughts?