You need to sign in to do that
Don't have an account?
Abhijit Shrikhande 10
How can I get the ApexJobId of the instance?
I have an Queueable class.
Example:
Example:
In my Queueable class, I plan to send an email to certain users in case the process falters or fails along the way. I need to get the ApexJobId of the running process for that. How can I get the ApexJobId from within the queueable class?
Example:
public class AsyncExecutionExample implements Queueable { public void execute(QueueableContext context) { Account a = new Account(Name='Acme',Phone='(415) 555-1212'); insert a; } }I am calling this class from another class.
Example:
ID jobID = System.enqueueJob(new AsyncExecutionExample());
In my Queueable class, I plan to send an email to certain users in case the process falters or fails along the way. I need to get the ApexJobId of the running process for that. How can I get the ApexJobId from within the queueable class?
All Answers