Fire event from record producer

Sandy7
Tera Expert

hello,

I have a record producer, and I need to trigger an event from a dropdown variable value. 

So, on the record producer I have a variable called Location. If location = A, I want an event trigged so I can call it from a notification.

I have this in the Record Producer script but it is not working.. 

I dont think i have it coded properly. Any ideas?

 

Thanks 

var location = producer.associate_site_and;


if (location == 'Internal - Charlotte') {

gs.eventQueue("contact_center_internal", current, eventParm1);
}

 

9 REPLIES 9

Mike Patel
Tera Sage

try below

var location = producer.associate_site_and.getDisplayValue();

if (location == 'Internal - Charlotte') {
    gs.eventQueue("contact_center_internal", current, '', '');
}

Hi Mike, thanks for the response..here is a screenshot of the script on the record producer and it doesn't seem to be firing the event . Do you have any other ideas? THanks!

 

 

find_real_file.png

Mohit Kaushik
Mega Sage
Mega Sage

Hi There,

Can you check if the name of event is correct? and this event must be present in your event registry table as well. Plus the parameter also should be either in single quotes or it should be a variable. So please declare eventParm1 before using it.

Could you please confirm these?

 

Thank,

Mohit Kaushik

Thanks,
Mohit Kaushik
ServiceNow MVP (2023-2025)

Hi, thanks for the reply. i've removed the parm, i am not passing one. Here is the code I have now. 

Yes, the event name is correct and it's also registered. Any ideas?

 

find_real_file.png

Hi Sandy,

Just pass '' in place of current also and try.

gs.eventQueue("contact_center_internal",'','','');

Check the below link also

https://community.servicenow.com/community?id=community_question&sys_id=f2146127db678c94414eeeb5ca96194c

 

Thanks,

Mohit Kaushik

Thanks,
Mohit Kaushik
ServiceNow MVP (2023-2025)