How to trigger/execute/run an on-demand scheduled job from Business rule script

Nayana N
Tera Contributor

I want to trigger a scheduled job from Business rule. I am using the below script but its throwing error.

var gr = new GlideRecord('sysauto');
gr.addQuery('sys_id','25b758811b6e8d102d8a0d45ec4bcb35');
gr.query();
if (gr.next()) {
   
    SncTriggerSynchronizer.executeNow(gr);
    gs.info("Successfully executed the Scheduled Job");
   
}
2 REPLIES 2

Mark Manders
Mega Patron

A business rule is triggered in some kind of way. Why not just use that trigger on your scheduled job? It sounds like a few too many steps to get the result.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

Community Alums
Not applicable