- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-24-2017 01:23 PM
Hi ServiceNow Community Developers,
Do you know if there is a way to trigger a scheduled job from a business rule. The input to the scheduled job would be the serial number so I would like to pass that along from a business rule. Please advise.
Thanks,
Johannes
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-24-2017 01:31 PM
Hi Johannes,
This is an interesting question, and not a typical one at that. Scheduled jobs are normally set to run at a specific time, interval, etc. Business rules run based on a database trigger. They are two different use cases in my mind. What's more, scheduled jobs don't take parameters. It sounds like you might need a script include or something else instead.
Can you tell me more about what you are trying to accomplish? I'd like to understand better what your requirement so I can offer an appropriate solution or options.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-24-2017 01:40 PM
You can use some thing like bellow but is not a best practice to do this using a business rule. As suggested by Chuck and pradeep please provide more details.
var rec = new GlideRecord('sysauto_script');
rec.get('name', 'YOUR_JOB_NAME_HERE');
SncTriggerSynchronizer.executeNow(rec);
Thanks,
Ganga.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-24-2017 01:44 PM
Hi Guys,
Do you know if I can use callback functions in a script include? Please advise.
Thanks,
Johannes

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-24-2017 01:59 PM
Hi Johannes,
Callback functions are usually used for async operations. It would really help us if you provided some detail around what your requirements are so we can understand the context.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-24-2017 02:27 PM
Chuck,
I like the XY reference. I've never seen that before, but very true in everything. (Just yesterday another user asked me to get a "disc with the OS for Microsoft Word" to reinstall when his laptop died... )
-Brian

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-24-2017 05:15 PM
Thanks. One of our developers passed that along. I absolutely love it when it comes to understanding requirements. I'm as guilty as anyone of abusing it. "Do we have a way to do ABC in ServiceNow?" And someone will throw that back in my face. We all think we know what the solution should be and when we get in trouble we ask for help on that solution, but there may be another (better) way to solve the requirement that we haven't thought of.
That's what makes this community so great!