我通过system.scheduleBatch(BatchableClass(查询),'Job Name',MinutesToExecute)方法调用批处理。如何检查批处理作业作业名称是否已安排好?
提前致谢。
答案 0 :(得分:1)
来自:https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_scheduler.htm
您可能希望执行以下操作:
CronTrigger ct =
[SELECT TimesTriggered, NextFireTime
FROM CronTrigger WHERE Id = :jobID AND NextFireTime > :DateTime.Now()];
我没有检查确切的语法,但我在开发者控制台验证了这一点:
SELECT Id FROM CronTrigger where NextFireTime > today