You need to sign in to do that
Don't have an account?

How to chain job using Queueable Apex
I am trying to chain job but the inner class code is not executing.
public class MyQueueable1 implements Queueable { Public Static list < Account > acclist = new list < Account > (); public MyQueueable1() { } public void execute(QueueableContext context) { System.enqueueJob(new MyQueueable2()); } public class MyQueueable2 implements Queueable { public MyQueueable2() { } public void execute(QueueableContext context) { List < Account > a = [SELECT Id, Name FROM Account WHERE Id =: acclist]; } } }
refer this link it may helpful for you
http://www.infallibletechie.com/2016/08/queueable-apex.html
Thank you
Chaining Jobs:
If you need to run a job after some other processing is done first by another job, you can chain queueable jobs. To chain a job to another job, submit the second job from the execute() method of your queueable class. You can add only one job from an executing job, which means that only one child job can exist for each parent job. For example, if you have a second class called SecondJob that implements the Queueable interface, you can add this class to the queue in the execute() method as follows:
For more deep dive : https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_queueing_jobs.htm
Note: Please mark this as best answer to help others, if this resolves what you are trying to resolve.