- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2017 09:28 AM
Hi guys,
I wrote a script for Scheduled Job which runs on demand:
When I click "Execute Now" button - I expect to see either info message or console log.
But it shows me nothing.
Debugger also doesn't stop on break-points.
Please advise where I am wrong?
Thanks.
var gr = new GlideRecord('x_11111_notes_customer_reminders');
gs.addInfoMessage("test");
console.log('test');
gr.addQuery('status', 'Scheduled');
while (gr.next()) {
var customer = {
name: gr.getDisplayValue('customer'),
id: gr.customer
};
gs.addInfoMessage("customer", customer);
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2017 09:41 AM
Scheduled jobs operate in the background via worker so you won't be able to see any foreground messages in the console or on the screen. You can use gs.log() to put a message in the Logs and view that way but again you won't be able to see them in foreground.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2017 09:41 AM
Scheduled jobs operate in the background via worker so you won't be able to see any foreground messages in the console or on the screen. You can use gs.log() to put a message in the Logs and view that way but again you won't be able to see them in foreground.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2017 10:35 AM
Hi Ivan,
agreed with michael.ritchie
In sys_trigger table there is a field Run count which gets incremented by one whenever schedule job get executed. you can check that also
Thanks,
Harshvardhan

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-03-2018 08:22 AM
Hi,
I've published a short article about how you can test Scheduled Jobs with the Script Debugger.
If you are interested, take a look at it here.
Hope you find it useful.
Thanks,
Cody