How can I check in Apex if a batch is scheduled?

Iliablun

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.

raffters

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] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

How can I run a batch file with a loop as a scheduled task?

분류에서Dev

How can I call a batch file within another batch file?

분류에서Dev

How can I check for an @ in a regular expression?

분류에서Dev

How can I check if a gzipped file is empty?

분류에서Dev

How i can check internet connection? android

분류에서Dev

How can i resolve the path laocation in batch file

분류에서Dev

How can I zero-pad numbers in a Batch FOR loop?

분류에서Dev

how can I remove white space in a string and replace it with (;) in batch

분류에서Dev

How can I extract text before a character or string in a batch file?

분류에서Dev

How can I check what version of the VI editor I have?

분류에서Dev

How can I check which JRE version I have?

분류에서Dev

How to check if the stored procedure is scheduled to run at specific time

분류에서Dev

How can I check if there is a signature associated with a deb package?

분류에서Dev

How can I check the available version of a package in the repositories?

분류에서Dev

How can I check whether a string of words exists in php

분류에서Dev

How can I check dependency list for a deb package

분류에서Dev

How can i check repeated items in color.xml Android

분류에서Dev

how can I check which submit button is clicked

분류에서Dev

How can i check every alphabet inside one string variable?

분류에서Dev

How can I check for the existance of an enum value in an array of Enums?

분류에서Dev

How can i check if an item is part of a specific menu [Joomla 3.3]

분류에서Dev

How can I check if rsync made any changes in bash?

분류에서Dev

How can I check if my system needs more PSU power?

분류에서Dev

How can I check if .dll are part of the .net 2.0 Framework?

분류에서Dev

How can I check if upstart is installed in ubuntu server and how can I install it?

분류에서Dev

How I can I start a powershell command line from a batch file and enforce it to stay open?

분류에서Dev

How to check if a batch file has ANY parameters?

분류에서Dev

motd message, when I log in using ssh, tells me I have a mail, how I can check it?

분류에서Dev

I want to write a batch file that internally calls python script and I want python script to return some value to the batch file. how can I do that?

Related 관련 기사

  1. 1

    How can I run a batch file with a loop as a scheduled task?

  2. 2

    How can I call a batch file within another batch file?

  3. 3

    How can I check for an @ in a regular expression?

  4. 4

    How can I check if a gzipped file is empty?

  5. 5

    How i can check internet connection? android

  6. 6

    How can i resolve the path laocation in batch file

  7. 7

    How can I zero-pad numbers in a Batch FOR loop?

  8. 8

    how can I remove white space in a string and replace it with (;) in batch

  9. 9

    How can I extract text before a character or string in a batch file?

  10. 10

    How can I check what version of the VI editor I have?

  11. 11

    How can I check which JRE version I have?

  12. 12

    How to check if the stored procedure is scheduled to run at specific time

  13. 13

    How can I check if there is a signature associated with a deb package?

  14. 14

    How can I check the available version of a package in the repositories?

  15. 15

    How can I check whether a string of words exists in php

  16. 16

    How can I check dependency list for a deb package

  17. 17

    How can i check repeated items in color.xml Android

  18. 18

    how can I check which submit button is clicked

  19. 19

    How can i check every alphabet inside one string variable?

  20. 20

    How can I check for the existance of an enum value in an array of Enums?

  21. 21

    How can i check if an item is part of a specific menu [Joomla 3.3]

  22. 22

    How can I check if rsync made any changes in bash?

  23. 23

    How can I check if my system needs more PSU power?

  24. 24

    How can I check if .dll are part of the .net 2.0 Framework?

  25. 25

    How can I check if upstart is installed in ubuntu server and how can I install it?

  26. 26

    How I can I start a powershell command line from a batch file and enforce it to stay open?

  27. 27

    How to check if a batch file has ANY parameters?

  28. 28

    motd message, when I log in using ssh, tells me I have a mail, how I can check it?

  29. 29

    I want to write a batch file that internally calls python script and I want python script to return some value to the batch file. how can I do that?

뜨겁다태그

보관