Can I run a scheduled job (on-demand) from a script?

tt-jtw
Kilo Expert

I have a custom script that runs as a Scheduled Job.   There are times that I would like to kick off that job on-demand from another script (or even a workflow).   Is there an API to find the scheduled job and execute it?

1 ACCEPTED SOLUTION
11 REPLIES 11

Any reason why she couldn't just skip straight to SncTriggerSynchronizer.executeNow( sys_id_of_scheduled_job );   ?


Sorry rfedoruk



I didn't see you answer before I posted.


Pffft!   No need to apologize NOWBro.   I'm just wondering if I'm missing something by not having the gliderecord first.


It looks like the main difference is mine holds the sys_id, where as the wiki's holds the entire object.   Not sure if that'll be problematic ro not.


Thanks all!   Can't believe I missed that in the doc.   Appreciate the help.


Oh! I see!   Sorry again!   haha I didn't spot that, I thought it was exactly the same code!



I was checking the UI action, it seems that you do need to pass the GlideRecord object, not completely sure if it will work with the sys_id.