Clarifying things regarding the gs.eventQueueScheduled() method

Bogdan18
Tera Guru

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

 

1 ACCEPTED SOLUTION

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.

View solution in original post

4 REPLIES 4

Deepak Ingale1
Mega Sage

It creates an entry in sys_trigger table. 

Bogdan18
Tera Guru

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.

find_real_file.png

 

Thanks,

Bogdan

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.

Thanks Deepak!