I am calling a batch through a system.scheduleBatch(BatchableClass(query), 'Job Name', MinutesToExecute) method. How can I check if the batch job Job Name is already scheduled?
Thanks in advance.
From: https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_scheduler.htm
You would want to do something like:
CronTrigger ct =
[SELECT TimesTriggered, NextFireTime
FROM CronTrigger WHERE Id = :jobID AND NextFireTime > :DateTime.Now()];
I didn't check that exact syntax, but I verified this works in the dev console:
SELECT Id FROM CronTrigger where NextFireTime > today
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다