How to call scheduled job from business rule
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-10-2024 08:45 PM
How to call scheduled job from business rule
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-10-2024 08:48 PM
Hi @sanket mohite ,
Below is the code snippet which we can write in business rule, script include on any server side script to execute the scheduled job when we need it means OnDemand
var objSchedule = new GlideRecord('sysauto_script'); //sysauto_script is a schedule job table name.
objSchedule .addQuery('name','--ScheduleJobName---');
objSchedule .query();
if(newGR.next()){
SncTriggerSynchronizer.executeNow(objSchedule ); //This will execute the schedule job mentioned above in addQuery.
}
For more information follow below link -
https://www.basicoservicenowlearning.in/2020/04/scheduled-jobs-servicenow.html
if my response proves useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful." This action benefits both the community and me.
Thanks,
Astik