Tell me more ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

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?

share|improve this question
1  
Related - Ideas:CronTrigger Name field needs to be exposed – Daniel Ballinger Aug 14 '12 at 2:27
The CTO of Apprio all but demanded this and it's still not there? Wow. – ca_peterson Aug 14 '12 at 2:38

1 Answer

up vote 3 down vote accepted

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.