trigger notification by UI Action

Shir Sharvit
Tera Contributor

Hey

 

how to trigger notification when clicking  a button on incident form in workspace?

i have tried to create an event but it doesnt work.

 

This is the UI action by created:

ShirSharvit_0-1704366343886.png

 

This is the Event by created:

ShirSharvit_1-1704366383443.png

 

2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

@Shir Sharvit 

the widget client script won't support gs object which is server side

So please use GlideAjax and then use gs.eventQueue there

Pass the record sysId to ajax function, do GlideRecord there and use gr object in eventQueue() function

I hope you will be able to complete the logic based on above suggestion by following docs etc

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

thank you, can you please help me write the script

 

function onClick(g_form) {

    g_form.setValue('u_supplier_status', 8);
    g_form.save();

    var gr = new GlideRecord('incident');
    gr.addQuery('number', g_form.getValue('number'));
    gr.query();

    if(gr.next()) {
        gs.eventQueue('report_vendor', gr);
       
    }


}