I have a class that is Database.Batchable which I execute via Database.executeBatch. How do I find the job status Id using the id returned from Database.executeBatch? It doesn't seem to match the Id I get from querying AsyncApexJob. Is there a way to get the status via Apex?

  • Did you check the answer here? It's not working for you? Commented Apr 1, 2019 at 21:14

1 Answer 1


The ids are truncated on the salesforce ui but you can query it via

SELECT Id, Status, ApexClassID, JobItemsProcessed, TotalJobItems, JobType, CompletedDate, ExtendedStatus FROM AsyncApexJob WHERE Id = 'id'

  • Not sure how this answers your original question - can you update your question? Commented Apr 1, 2019 at 21:22
  • Also it would be better to show this as using a binding variable on the assumption you would do this from Apex.
    – Phil W
    Commented Apr 1, 2019 at 22:39

You must log in to answer this question.

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