Service Portal Message colour change

Raji15
Tera Contributor

Hi, I have a requirement that to change the color of the the message that displayed under a variable in a catalog item. I have attached picture for the reference. How do I change the background color of the message?

2 ACCEPTED SOLUTIONS

Saurav11
Kilo Patron
Kilo Patron

Hello,

 

First we need to know how are you displaying the message below the field. I believe looking at the image it is a field message which is set via client script or UI policy and it is blue in color which prompts me that it is of type info

 

There are three types:-

 

  • type — 'info', 'error', or 'warning'; defaults to info if not supplied. So you can change the color based on the type given in the syntax

Example:-

 

g_form.showFieldMsg('impact','Low impact not allowed with High priority','error');

 

To understand more check the below official docs:- 

 

https://docs.servicenow.com/en-US/bundle/tokyo-application-development/page/script/useful-scripts/re...

 

Please mark my answer as correct based on Impact.

View solution in original post

Theo BOULANGER
Giga Guru

Hi @Raji15 

 

this is a showfieldmessage for exemple : 

g_form.showFieldMsg('app_media', "This is a test message", 'warning');

 

The third parameter will be the color, by default it's blue but warning will be orange.

 

You have to find it in a catalog client script.

What color do you need ?

 

Regards,

 

View solution in original post

4 REPLIES 4

Saurav11
Kilo Patron
Kilo Patron

Hello,

 

First we need to know how are you displaying the message below the field. I believe looking at the image it is a field message which is set via client script or UI policy and it is blue in color which prompts me that it is of type info

 

There are three types:-

 

  • type — 'info', 'error', or 'warning'; defaults to info if not supplied. So you can change the color based on the type given in the syntax

Example:-

 

g_form.showFieldMsg('impact','Low impact not allowed with High priority','error');

 

To understand more check the below official docs:- 

 

https://docs.servicenow.com/en-US/bundle/tokyo-application-development/page/script/useful-scripts/re...

 

Please mark my answer as correct based on Impact.

Raji15
Tera Contributor

Hey, thanks much. It worked!

Theo BOULANGER
Giga Guru

Hi @Raji15 

 

this is a showfieldmessage for exemple : 

g_form.showFieldMsg('app_media', "This is a test message", 'warning');

 

The third parameter will be the color, by default it's blue but warning will be orange.

 

You have to find it in a catalog client script.

What color do you need ?

 

Regards,

 

Hey, thanks much. It worked!😊