Been talked about before and the requests were delivered in Winter 14 (CronJob Name)
But I cannot seem to find the relationship between the ApexAsyncJob and the Actual CronTrigger
- If I abort the AsyncApexJob (Via the ID obtained in a query), its status is updated to aborted from the Apex Jobs listing BUT the crontrigger part still shows up in the Scheduled Jobs section and happily runs at the next cycle.
Trying to manage the scheduling and aborting of a job from a configuration screen
- I can store the jobID and that is all well and good, BUT if a user scheduled the class via the Salesforce Schedule Apex UI then the entire process goes haywire.
- If they schedule via the standard UI, they could name it anything so there is no way for me to tell which cron job goes with the actual ApexAsyncJob that I see
- I can stop them from scheduling via regular UI by throwing an error in the constructor of the scheduled class but that throws a nasty error saying "Invalid class" or something
The goal is that Once I have the class ID, I should be able to tell if it is scheduled (Done) AND be able to delete the cronjob. This way I can manage the job from the configuration page regardless of where it was scheduled. If only the ClassName was available in the CronTrigger.......
Anyone have any other ideas?