3

assuming I have Scheduleable class called 'MyscheduledClass' , how do i check if this class is running now as scheduled job ? I dont means to check if it's was scheduled , just if it is running now.

5

You can query AsynsApexJob object. A sample query would be;

AsyncApexJob aaj = [SELECT Id, Status, ApexClassID FROM AsyncApexJob WHERE ApexClassID = 'your schedulable class id'];

if(aaj.Status == 'Processing'){
     //running
}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.