1

There are schedule A and Schedule B I want to run Schedule B after Schedule a completed Is there a way a way i can do it?

1
  • 1
    does schedule A invoke a batchable? or does it do all of its work in the schedulable execute()?
    – cropredy
    Oct 17, 2018 at 4:09

1 Answer 1

0

You can schedule another class by using system.schedule method but keep in mind you must implement the schedulable interface for the class which you want to schedule.

public class Batchclassparent implements Schedulable {

    public void execute(Schedulablecontext context){

        system.debug('inside parent');
        system.schedule('testjob', '0 0 14 * * ?', new Batchclasschild());
    }
} 

public class Batchclasschild implements Schedulable {

    public void execute(Schedulablecontext context){

        system.debug('inside child');
    }
} 

Not the answer you're looking for? Browse other questions tagged .