In a UI policy, can we add gs.addinfomessage ?

Vivek Verma
Mega Sage
Mega Sage

Thank You !

6 REPLIES 6

Harish Ragz
Kilo Guru

Yes, we can use gs.addinfomessage() in UI Actions.

Actually, UI Action can be used on Client side and Server Side.

https://docs.servicenow.com/bundle/jakarta-application-development/page/app-store/dev_portal/API_reference/glideSystemScoped/concept/c_GlideSystemScopedAPI.html(you will get an idea by seeing this information.)

 

 

Please Hit ✅Correct(If it is a correct solution) or Hit ✅Helpful(If it is useful).

karthik120
Giga Expert

Hello,

 

You can use addinfomessage in UI Policy.

Use script section and include g_form.addInfoMessage("YOUR MESSAGE");

 

Thanks,

Karthik

Anurag Tripathi
Mega Patron
Mega Patron

UI Policies run on client side spo you wont have access to gs there

 

Here is a list of messages ini servicenow mentioning what can be used whrere with syntax.

 

https://docs.servicenow.com/bundle/kingston-application-development/page/script/general-scripting/reference/r_ScriptingAlertInfoAndErrorMsgs.html

-Anurag

Dante Ditan
Kilo Sage

Hello,

 

Yes, But the gs.addinfomessage is only applied for server side script. Since the UI policy is in client side script the alternative for that is to use the g_form.addInfoMessage();

 

You need to check the "Run script" in UI policy:

 

find_real_file.png

 

Thank you

Dante