1

I need some job to be run on schedule every x hours. I see that official documentation claims that none special characters are allowed for hours portion of CRON expression, however, when I try on sandbox to execute the following code

System.schedule('Run Batch every five hours', '0 0 2/5 * * ?', new BatchScheduler('Batch') );

I don't receive any error or exception and it seems to be scheduling it every 5 hours. Since this is not documented I am not sure if I could rely on this to run on production.

Can I rely upon this undocumented feature to use in production code?

3
  • 1
    U can never rely on undocumented observations. They can change / cease to work at any time
    – Eric
    Commented May 3, 2017 at 8:35
  • However, these undocumented observations are suggested as an answer to another questions salesforce.stackexchange.com/questions/16841/…
    – Patlatus
    Commented May 4, 2017 at 7:27
  • I am not agreeing or disagreeing with you on the undocumented part. And yes there are answers like that everywhere. It does not change my comment.
    – Eric
    Commented May 4, 2017 at 12:26

0

You must log in to answer this question.