Showfield message not shown in red in portal

MattCoscos
Tera Contributor

Hi,

 

Have anyone encountered this issue wherein the error type is not shown in red?

 

MattCoscos_0-1740986629391.png

 

MattCoscos_1-1740986646138.png

 

10 REPLIES 10

Prathamesh1
Giga Guru

Hi @MattCoscos ,

 

Use addErrorMessage() method to display in red.

Check this for more info : Glide Methods 

 

Please Mark helpful/correct if applicable.

Thankyou!

MattCoscos
Tera Contributor

Hi, this script disappears after 2 seconds, i am trying to have an error message that stays on the page until the user clicks X

Juhi Poddar
Kilo Patron

Hello @MattCoscos 

The script is working perfectly in my PDI, so there’s no issue with the script itself.

A possible reason could be a customization that is overriding the default behavior.

Note: Messages displayed using showFieldMsg() will persist until explicitly removed with hideFieldMsg().

Script:

 

g_form.showFieldMsg("field2","At least one field (Mass Payment/Direct debit/ HR Payment/Treasury Payment) must have a value other than 'Not Applicable'. Please select at least one relevant option.","error");

 

Result:

JuhiPoddar_0-1740994849935.png

Hope this helps!

 

"If you found my answer helpful, please like and mark it as an "accepted solution". It helps future readers to locate the solution easily and supports the community!"

 

Thank You
Juhi Poddar

Ankur Bawiskar
Tera Patron
Tera Patron

@MattCoscos 

it should show in red.

where have you written this script?

If my response helped please mark it correct and close the thread so that it benefits future readers.

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