Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Error style not working in UI Policy Action

andrespinilla
Tera Contributor

Hey team,

 

I'm trying to create a UI Policy Action to display an error message but for some reason it is not displaying the message with the red background. However, when I use warning or info the backgrounds yellow and blue work.

 

Does anybody know how to fix this issue?

6 REPLIES 6

Bhuvan
Giga Patron

@andrespinilla 

 

Can you share screenshot of UI policy that is not working as expected ?

 

If this helped to answer your query, please mark it helpful & accept the solution.

 

Thanks,

Bhuvan

@andrespinilla 

 

You can use below knowledge article for troubleshooting

 

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0547063

 

If this helped to answer your query, please mark it helpful & accept the solution.

 

Thanks,

Bhuvan

HanuBhagav
Tera Contributor

hi @andrespinilla ,


Please try to use one of below methods:
g_form.addErrorMessage('Form Error Message Text');

//Field error message
g_form.showFieldMsg('impact','Priority is high!','error');


Also Check if there any Client Scripts which take priority Over UI Policy.

Thanks & Regards,
Hanu


Shubhras
Tera Contributor

@andrespinilla 

 

  • UI Policy Actions don’t support red error banners → only Info (blue) and Warning (yellow).

  • For red background error messages, you must use Client Scripts with g_form.showFieldMsg() or g_form.addErrorMessage().

Thanks,

Shubhra Saxena