- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2020 11:12 AM
Hello,
I have a requirement to run scheduled email report (on Demand) to run on an event trigger.
I don't see any option to execute the report on event trigger. Is there any work around I can use?
Please advise.
Thanks.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2020 12:24 PM
Hi Rajan,
You cannot directly trigger scheduled jobs based on the event. However, you can trigger Script Action based on an event and inside Script action you can use the below script to trigger an on-demand scheduled job.
var schReportGr = new GlideRecord('sysauto_report');
schReportGr.addQuery('sys_id','<SYS ID>'); //replace <SYS ID> with actual sys_id of your schedule report
schReportGr.query();
if(schReportGr.next()){
SncTriggerSynchronizer.executeNow(schReportGr);
}
Note - Above script will work in the Global scrope.
Hope that helps!
Regards,
Muhammad
Muhammad

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2020 12:24 PM
Hi Rajan,
You cannot directly trigger scheduled jobs based on the event. However, you can trigger Script Action based on an event and inside Script action you can use the below script to trigger an on-demand scheduled job.
var schReportGr = new GlideRecord('sysauto_report');
schReportGr.addQuery('sys_id','<SYS ID>'); //replace <SYS ID> with actual sys_id of your schedule report
schReportGr.query();
if(schReportGr.next()){
SncTriggerSynchronizer.executeNow(schReportGr);
}
Note - Above script will work in the Global scrope.
Hope that helps!
Regards,
Muhammad
Muhammad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2020 01:19 PM
Thanks Muhammad.
That was really helpful. I am able to trigger the report directly from the Business Rule. I was first thinking of generating event via Business Rule, but no need to take that path.
Thanks again.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2023 02:39 AM
Hey Muhammad,
I have a similar requirement, but your code isn't working in my case. How would you do to adapt it to work in a scoped application ? I'm received that error:
Uncaught TypeError: GlideRecord is not a constructor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2025 06:42 AM
Thank you so much. This was really helpful