addCronJob error

I’ve added the following to the solution’s startup script:

// schedule daily update at 12:20am with no expiry
plugins.scheduler.addCronJob('12:20am','0 20 0 ? * ?',globals.dailyUpdate());

I then closed the solution and reopened it. It got the following error message:

Can’t find method
com.servoy.r2.plugins.scheduler.SchedulerProvider.js_addCronJob(string,string,undefinded)

The globals method “dailyUpdate()” is clearly present and I’m able to manually trigger it.

If I remove the “addCronJob” instruction from the startup script, close the solution, then re-open it, the error doesn’t trigger.

Puzzled.

Try with:

plugins.scheduler.addCronJob(‘12:20am’,‘0 20 0 ? * ?’,dailyUpdate);

as reported in the “move sample” of the scheduler

automazione:
Try with:

plugins.scheduler.addCronJob(‘12:20am’,‘0 20 0 ? * ?’,dailyUpdate);

as reported in the “move sample” of the scheduler

That seems to catch it. I was caught off guard by the unexpected syntax for calling a global method.

There was also another flaw. Should be: ```
plugins.scheduler.addCronJob(‘12:20am’,‘0 20 0 ? * *’,dailyUpdate);

The original called for "no special value" for **both** day of month **and** day of week. The revision calls for **every** day of the week. The docs are "legal" although not as transparent as they could be. <img src="{SMILIES_PATH}/icon_wink.gif" alt=":wink:" title="Wink" /> 

Thanks. My first Cron seems to be on its way.