function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AveeAvee 

How to get Schedule ApexClass Id or Name from Schedule job Name ?

Hi,

 

How can i get Schedule ApexClass Id or Name  from Schedule job Name.

magicforce9magicforce9

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.

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];

 

AveeAvee
Hi,

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
rsomanwal1.3902985271536682E12rsomanwal1.3902985271536682E12
SELECT Id, CronJobDetail.Id, CronJobDetail.Name, CronJobDetail.JobType
FROM CronTrigger whrere CronJobDetail.Name = 'My Job Name'
Sampath BukkaSampath Bukka
Hi 
How do I get scheduled job Id

Shankar Krishna 8Shankar Krishna 8
Hi. How do i get the current schedule job id in the same class