What can be the issue if AsyncApexJob returns two records for only one executed instance of a batch?

173    Asked by DanPeters in Salesforce , Asked on Aug 29, 2023

When I execute one batch, it runs only once. It has been verified by me from ‘ApexJobs’ from Setup. But as I am enquiring about the AsyncApexJob for the batch class, two records are being returned, which are created at the same time. 

I have applied the below query:

Result for the query above:

But when looked at the Apex Jobs, only one instance of one time is shown:

I need someone to assist me as I am unable to identify the issue here.

Answered by Darsh K

To get a better understanding, you can add additional fields to your question on AsyncApexJob. You can get these fields in the Object Reference for this object.




Most probably, you are having jobs of JobType BatchApexWorker that indicates at Jobs of type BatchApex

The document says as follows:


Your Answer

Interviews

Parent Categories