Scheduled Job Name is some thing that you specify when you schdule a batch job, so you should know thtat but if you are looking for scheduled job ID that will be returned as string..for exmaple see below.
String ScheduledJobID = system.schedule( <ScheduledJobName>, <CronExpression>, new schedulable_class());
If you are looking for JobName at runtime then you can do it by querying CornTrigger as below(but you need to have the jobID to query for specific job...as below
CronTrigger job = [SELECT Id, CronJobDetail.Id, CronJobDetail.Name, CronJobDetail.JobType FROM CronTrigger where Id = :ScheduledJobID];
Thanks a lot for reply. But I am not looking for Job Name , I know how to get Job Name and using that job Name I want to get Schedule Apex Class Name or Schedule Apex Class Id. I need Schedule Apex Class Name or Schedule Apex Class Id from Schedule job Name.
This message is for the designated recipient only and may contain privileged, proprietary, or otherwise confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy. . ______________________________________________________________________________________
Hi,
Scheduled Job Name is some thing that you specify when you schdule a batch job, so you should know thtat but if you are looking for scheduled job ID that will be returned as string..for exmaple see below.
If you are looking for JobName at runtime then you can do it by querying CornTrigger as below(but you need to have the jobID to query for specific job...as below
Thanks a lot for reply. But I am not looking for Job Name , I know how to get Job Name and using that job Name I want to get Schedule Apex Class Name or Schedule Apex Class Id.
I need Schedule Apex Class Name or Schedule Apex Class Id from Schedule job Name.
Thank you,
With Regards,
--------------------------------------------------------------
Avaneesh Singh
Accenture
Email: avaneesh.singh@accenture.com
Cell: +91 9623502371
--------------------------------------------------------------
________________________________
This message is for the designated recipient only and may contain privileged, proprietary, or otherwise confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy. .
______________________________________________________________________________________
www.accenture.com
FROM CronTrigger whrere CronJobDetail.Name = 'My Job Name'
How do I get scheduled job Id