Is there a way to add error message styling using a Business Rule for a List View?

Daniel Rodrigue
Mega Expert

Currently I have a BR that popup a message: "Error - This field is mandatory", when trying to change a field in List View.

The way I configured this message is by setting the "When to run conditions" of the BR and in the tab Actions "Add message" is selected and with the message above.

This is working fine, but the styling of the message is like an info message. Is there a way to change this styling more like an Error message?

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

it's HTML field you can use color etc

find_real_file.png

OR

you can use script section and use gs.addErrorMessage("Error - This field is mandatory");

regards
Ankur

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

View solution in original post

3 REPLIES 3

Mahesh23
Mega Sage

Hi,

Try below code in script

Check the Advanced checkbox in BR.

gs.addErrorMessage("YOUR_MESSAGE");

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

it's HTML field you can use color etc

find_real_file.png

OR

you can use script section and use gs.addErrorMessage("Error - This field is mandatory");

regards
Ankur

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

Hi Ankur, sorry for the late response, at the end I use the second solution:

gs.addErrorMessage("Error - This field is mandatory");

 

Because using HTML color styling and such, when the error message appears in the list view is not changing the styling.