Development questions

Write a SOQL query on AsyncApexJob to monitor the status and number of errors of currently running Batch Apex jobs.

Query AsyncApexJob for batch jobs that haven't finished and read progress and error counts.

soql
SELECT Id, ApexClass.Name, Status, JobItemsProcessed, TotalJobItems, NumberOfErrors, CreatedDate
FROM AsyncApexJob
WHERE JobType = 'BatchApex' AND Status IN ('Queued', 'Preparing', 'Processing')

Remove the status filter and add ExtendedStatus to investigate failed jobs.

soqlscenarioasync-apexmonitoring