Event Queue is not getting triggered

jamesmig_0007
Tera Contributor

I have requirement where I am triggering the event using gs.eventQueue but it is not working as expected. 

 

 // Check if a specific condition is met (e.g., a field is updated)
    if (current.active != previous.active) { // Example: Trigger when 'active' changes
        var eventName = "user_status_changed"; // Define your custom event name
        var parm1 = current.sys_id;           // First parameter for the event
        var parm2 = current.active;          // Second parameter for the event
        
        // Trigger the event
        gs.eventQueue(eventName, current, parm1);
2 ACCEPTED SOLUTIONS

maheshkhatal
Mega Sage

Hi jamesmig,

    Your event is not getting triggered because you are missing on one more parameter. Please see below the syntax of gs.eventQueue api.

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

Fifth parameter being used for custom queue. But if you want you can skip one of the string_params and then it should work

 gs.eventQueue(eventName, current, parm1, parm2);
//if you want to not have value then you can do as shown below
 gs.eventQueue(eventName, current, parm1, ''); //i.e. empty string instead parm2

Mark my response helpful if it really helped you.

View solution in original post

@jamesmig_0007 

As per new community feature you can mark multiple responses as correct.

If my response helped please mark it correct as well so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

5 REPLIES 5

@jamesmig_0007 

As per new community feature you can mark multiple responses as correct.

If my response helped please mark it correct as well so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader