[SalesForce] Linking CronTrigger sObjects to Scheduled Jobs listings

When using System.schedule to add apex jobs to the scheduled jobs listing it creates a CronTrigger sObject containing the expression determining when the job is set to run. However this CronTrigger record does not contain the name of the scheduled job or the apex class to be run.

Likewise when viewing a scheduled job that was scheduled via System.schedule from the Setup > Monitoring > Scheduled Jobs page there is no "Manage" link that shows what apex class is being scheduled to run, only the job name.

It seems impossible from this to tell what apex class a scheduled job will run, and inversely what the job name of a CronTrigger is.

Am I missing something, or is there a huge gap in the administrative ability and APIs around scheduled apex?

Best Answer

There doesn't currently appear to be any mechanism for determining the apex class or the name of the scheduled job from Apex or via the API (See Ideas:CronTrigger Name field needs to be exposed).

As a stop gap measure, you could create a custom object or setting and manually map from the CronTriggerId returned by System.schedule() and the data that you require (ApexClass name or Id). Reference - Need a way to programatically change or delete a Scheduled Job