addInfoMessage is not working in NowUI while it is working in workspace

Rajat_Singhal
Tera Expert

I have written a following After Update BR in Approval table. Basically my requirement is to show info message whenever L2 manager approves a BIA.

This code is working and giving the info message in Workspace but same thing is not working in now UI

 

(function executeRule(current, previous /*null when async*/) {

    // Add your code here
    

    var gr = new GlideRecord("sn_bia_approval");
    gr.addQuery("users",current.approver);
    gr.addQuery("name","Level 3 Managers");
    gr.query();
    if(gr.next()){
      
        gs.addInfoMessage("hello test");
    
        gr.update();
    }

})(current, previous);
1 REPLY 1

Mohith Devatte
Tera Sage
Tera Sage

Hello @Rajat_Singhal ,

 

(function executeRule(current, previous /*null when async*/) {

    // Add your code here
    

    var gr = new GlideRecord("sn_bia_approval");
    gr.addQuery("users",current.approver);
    gr.addQuery("name","Level 3 Managers");
    gr.query();
    if(gr.next()){
      
        gs.addInfoMessage("hello test");
    
        gr.update();
action.setRedirectURL(current);
    }

 

Can you try this ?

Hope this helps 

Mark the answer correct if this helps you 

Thanks