如果安排批次,我该如何登记Apex?

时间:2015-04-09 15:34:00

标签: batch-file salesforce apex schedule

我通过system.scheduleBatch(BatchableClass(查询),'Job Name',MinutesToExecute)方法调用批处理。如何检查批处理作业作业名称是否已安排好?

提前致谢。

1 个答案:

答案 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