- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-08-2017 05:28 PM
Hi All,
I have a requirement to fire an event which will trigger a script action and SMS reminder prior to the scheduled appointment. Using this as an example https://docs.servicenow.com/bundle/jakarta-servicenow-platform/page/integrate/email-integrations/tas...
Now the issue is that when I fire the below event the fifth parameter is not setting the 'process on' field on the event record to the date/time in that field. It fires the event immediately as a result. I note that when I do this in the global scope i.e on the incident record it works to expectations.
gs.eventQueueScheduled("sn_customerservice.reminder",current,gs.getUserID(),gs.getUserName(),current.u_reminder)
Is this a limitation? or do I need to follow some additional steps to get it to work in a scoped app.
Appreciate your comments in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2017 08:08 AM
Anthony,
Looking into a little more on why this is happening, I have a feeling it is an issue with access to the "reminder" field when it is passed in. But if you generate a new GlideDateTime object and pass it the reminder field, and then pass the new GlideDateTime field to the method, it looks like it works as expected.
var gdt = new GlideDateTime(gr.reminder);
gs.eventQueueScheduled("x_snc_testschedule.test",gr,gs.getUserID(),gs.getUserName(),gdt);
Obviously using "current" instead of "gr" in your situation.
Thanks,
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2017 08:08 AM
Anthony,
Looking into a little more on why this is happening, I have a feeling it is an issue with access to the "reminder" field when it is passed in. But if you generate a new GlideDateTime object and pass it the reminder field, and then pass the new GlideDateTime field to the method, it looks like it works as expected.
var gdt = new GlideDateTime(gr.reminder);
gs.eventQueueScheduled("x_snc_testschedule.test",gr,gs.getUserID(),gs.getUserName(),gdt);
Obviously using "current" instead of "gr" in your situation.
Thanks,
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2017 03:06 PM
Thanks Chris. Right on the money.