How to trigger a scheduled job from a business rule

johannes5
Giga Expert

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

1 ACCEPTED SOLUTION

Chuck Tomasi
Tera Patron

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.


View solution in original post

17 REPLIES 17

Hi Gangadhar,

 

can we trigger scheduled script on insert of record in a customized table.?

Thanks

Hi Solmon, If you have a need to execute the same functionality both from a business rule and from your scheduled job, it would be better to save that functionality in a script include (as mentioned above). You would then call on that include from both your business rule and from the scheduled job, rather than using the BR to artificially fire off your scheduled job. If you post your actual requirement here, someone might have an even better solution for you. Thanks, -Brian

Brian summed this up nicely being able to reuse the functionality/code from a script include in to a BR and scheduled job.

 

BRs trigger on database operations. Scheduled jobs trigger timed schedules. Your requirement will drive which is appropriate. As Brian noted, let us know what you are trying to do and we can provide more information.