How can I query the class which the schedule job will call

I am trying to get the name of the schedule / batch classes called by the schedule job

Trying this

select Id,CronJobDetailId,CronJobDetail.Name,
       NextFireTime,PreviousFireTime,State,StartTime,EndTime,CronExpression,
       TimeZoneSidKey,OwnerId,TimesTriggered 
from CronTrigger 
where CronJobDetail.Name = 'Assetupdates'

The job was scheduled via execute anonymous and given a very undescriptive name

Thanks

Answer

Ok, found what I was looking for

select ApexClassId, Id, JobItemsProcessed, JobType, 
       Status, NumberOfErrors, MethodName 
from AsyncApexJob  
where JobType in ('BatchApexWorker','ScheduledApex')

Attribution
Source : Link , Question Author : Michael Gill , Answer Author : Scott Pelak

Leave a Comment