AsyncApexJob

Represents an individual Apex sharing recalculation job, a batch Apex job, a method with the future annotation, or a job that implements Queueable.

Supported Calls

describeSObjects(), query(), retrieve()

Fields

Field Name Details
ApexClassID
Type
reference,
Properties
Filter, Group, Sort
Description
The ID of the Apex class executing the job. Label is Class ID.
CompletedDate
Type
dateTime
Properties
Filter, Nillable, Sort
Description
The date and time when the job was completed.
ExtendedStatus
Type
string
Properties
Filter, Group, Nillable, Sort
Description
If one or more errors occurred during the batch processing, this contains a short description of the first error. A more detailed description of that error, along with any subsequent errors, is emailed to the last user who modified the batch class. This field is available in API version 19.0 and later.
JobItemsProcessed
Type
int
Properties
Filter, Group, Sort
Description
Number of job items processed. Label is Batches Processed.
JobType
Type
picklist
Properties
Filter, Group, Restricted picklist, Sort
Description
The type of job being processed. Valid values are:
  • Future
  • SharingRecalculation
  • ScheduledApex
  • BatchApex
  • BatchApexWorker
  • TestRequest
  • TestWorker
  • ApexToken
  • Queueable
MethodName
Type
string
Properties
Filter, Group, Nillable, Sort
Description
The name of the Apex method being executed. Label is Apex Method.
NumberOfErrors
Type
int
Properties
Filter, Group, Nillable, Sort
Description
Total number of batches with a failure. A batch is considered transactional, so any unhandled exceptions constitute an entire failure of the batch. Label is Failures.
Status
Type
picklist
Properties
Filter, Group, Restricted picklist, Sort
Description
The status of the job. Valid values are:
  • Holding1
  • Queued
  • Preparing
  • Processing
  • Aborted
  • Completed
  • Failed
1 This status applies to batch jobs in the Apex flex queue.
TotalJobItems
Type
int
Properties
Filter, Group, Nillable, Sort
Description
Total number of batches processed. Each batch contains a set of records. Label is Total Batches.

Usage

Use this object to query Apex batch jobs in your organization.