gs.flushMessages() and RP.isPopup() doesnot work in scoped application

G Balaji
Kilo Guru

HI,

We've a requirement to show the end-user with an info message on list view as "Use * to search".

We've a display business rule displaying an info message on list view.

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

// Add your code here
var c='Use * to search';
var index=0;
index = gs.action.getGlideURI().toString().indexOf('sn_grc_profile');


if(index == -1){


// it means it is form


}


else{

gs.flushMessages();
gs.addInfoMessage(c);
}

 


})(current, previous);

 

 

When the same business rule is appliced in GRC Profiles scope, compiler error is showing up stating flush message is not allowed in "sn_grc" scope. 

We've to flush existing messages since on every list edit the same message is shown up multiple times. I've tried !RP.isPopup() as well but it's not working in sn_grc scope.

Any pointers to fix this?

Thanks

 

4 REPLIES 4

SatheeshKumar
Kilo Sage
I think there is no other methods to replace the flush in scoped apps. As a workarround try adding g_form.clearMessages() in oncellEdit client script. It may help.

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Balaji,

You are correct. gs.flushMessages() is not available in scoped apps. Have you considered using gs.clearMessages()

Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

Raj68
Mega Guru

hi,

 gs.flushMessages() is not available in scoped apps. Have you considered using g_form.clearMessages() from a client script?

https://developer.servicenow.com/app.do#!/api_doc?v=jakarta&id=r_GS-flushMessages

If you feel this is a critical method to use in scoped apps, I invite you to open an enhancement request! Our product managers DO listen.

Enhancement requests: Tell us how you would improve the ServiceNow product

NOTE: Mark correct or helpful if it helps you.

Warm Regards,

Raj patel

 

Thanks everyone  for the response.

 

Is there any other means to show an info message in list view?

 

Why am I not able to use RP.isPopup(), though?