- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2019 01:33 AM
Hi guys,
I would like to get some clarifications regarding the gs.eventQueueScheduled() method used to trigger an event in the future. I am trying to learn exactly how to do this and I am a bit confused.
Consider this example:
1. Created a new field on the incident table On hold until - 'u_on_hold_until'
2. Created a 'before' BR which is automatically populating this field if State changes to On hold. It is populating the field with a date of 3 days in the future
3. Created another BR, this time an 'after' one and set the script to gs.eventQueueScheduled("incident.off.hold", current, current.sys_id,gs.getUserName(), current.u_on_hold_until);. The 'incident.off.hold' event is registered in the system. The BR condition is set to current.u_on_hold_until.changes();
My question is how will the event be triggered exactly when the On hold until date is reached? I am not seeing any schedules triggered in the system, so how will the system now to trigger the event at that specific date? Shouldn't we have eyes on this schedules or is this happening somewhere behind the scenes?
Also, if I have the BR from point 3 to trigger for 'after' I am not seeing an event being triggered but if I change it to 'before' I do see an event but it gets processed.
Thanks,
Bogdan
Solved! Go to Solution.
- Labels:
-
Event Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2019 03:19 AM
This indicates that event has been registered and it will be processed on the date mentioned in your screenshot, now how that happens?
It creates an entry in sys_trigger table which is nothing but the scheduled trigger which will execute on time stamp mentioned on process on field. You can check in this table for triggers due for run on date 09th Jan per your screenshot.
Note: Please mark reply as correct / helpful if it has answered your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2019 02:55 AM
It creates an entry in sys_trigger table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2019 02:58 AM
OK, so for anyone looking at this and having the same question I think I managed to understand how everything is coming together.
There is a field named 'Processed on' in the Event log which I believe keeps the event unprocessed until the due date is reached. I haven't found out where exactly the trigger is configured but I think this is enough for me. I will be testing this in the coming days.
Thanks,
Bogdan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2019 03:19 AM
This indicates that event has been registered and it will be processed on the date mentioned in your screenshot, now how that happens?
It creates an entry in sys_trigger table which is nothing but the scheduled trigger which will execute on time stamp mentioned on process on field. You can check in this table for triggers due for run on date 09th Jan per your screenshot.
Note: Please mark reply as correct / helpful if it has answered your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2019 02:27 AM
Thanks Deepak!