in gs.eventQueue("event name",current,parm1,parm2);

Vijay27
Tera Guru

in above syntax,where we use current and where we use gr(in place of curent)

2 REPLIES 2

Bryan Tay3
Mega Guru

hi Vijay, 

gs.eventQueue function is to trigger an event in ServiceNow where it takes in an event name, a glide record and parameter 1/2.

Depends on the usage of triggering an event, most of the OOTB build in Business Rules will be triggering an event and past in the 'current' record (context) and fire an event....

in a scenario where you will need to fire a series of event (E.g. batch/schedule jobs), you will query a series of GlideRecord and past it in to the gs.eventQueue function as 'gr' (result from a query etc).

Hope i interpret your question correctly and my explanation helps.

cheers...:)

Mike Patel
Tera Sage

Please refer to https://developer.servicenow.com/app.do#!/api_doc?v=kingston&id=r_ScopedGlideSystemEventQueue_String_Object_String_String_String

if you are firing event from lets say incident business rule, and want to fire notification that is based on incident. In this case you can use current.

If you want to fire event from another table lets say scheduled script than you will have to do gliderecord query.