Add an eventQueue to send a notification, from a GlideRecord

chatsaurav19
Tera Contributor

Hi All,

 

What should be the correct format to send a notification from a Glide Record ( in this case to the Hiring Manager )?

 

var gr1 = new GlideRecord('x_inpe_gbs_inf_gbs_infrastructure_roles');
gr1.addAddQuery('sys_id','07c13b0a8316a9548bb2f855eeaad3a5');
gr1.query();
while(gr1.next()){
var hiringManager = gr1.getDisplayValue('hiring_manager');
if (projectedHireDate < lastDayOfMonth){

gr1.update();
gs.eventQueue(<mail notification to Hiring Manager>)//Format
}
}

 

Thanks and Regards,

Saurabh Chatterjee

1 ACCEPTED SOLUTION

Ravi Chandra_K
Kilo Patron
Kilo Patron

Hello @chatsaurav19 

Greetings!

This is the Syntax.

gs.eventQueue('event_name', gliderecord_object, 'string_parm1', 'string_param2', 'string_queue')

In order to use gs.eventQueue, it requires a minimum of two parameters passed to it: an event name and an object instance.

refer detailed thread here:

https://www.servicenow.com/community/developer-articles/an-examination-of-gs-eventqueue/ta-p/2322341

In your case, try

gs.eventQueue('event_name', current, hiringManager)

please mark the answer as helpful and correct if helped.

Kind Regards,

Ravi Chandra

View solution in original post

1 REPLY 1

Ravi Chandra_K
Kilo Patron
Kilo Patron

Hello @chatsaurav19 

Greetings!

This is the Syntax.

gs.eventQueue('event_name', gliderecord_object, 'string_parm1', 'string_param2', 'string_queue')

In order to use gs.eventQueue, it requires a minimum of two parameters passed to it: an event name and an object instance.

refer detailed thread here:

https://www.servicenow.com/community/developer-articles/an-examination-of-gs-eventqueue/ta-p/2322341

In your case, try

gs.eventQueue('event_name', current, hiringManager)

please mark the answer as helpful and correct if helped.

Kind Regards,

Ravi Chandra