Showfield message not shown in red in portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2025 11:24 PM
Hi,
Have anyone encountered this issue wherein the error type is not shown in red?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2025 12:04 AM
Hi @MattCoscos ,
Use addErrorMessage() method to display in red.
Check this for more info : Glide Methods
Please Mark helpful/correct if applicable.
Thankyou!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2025 12:17 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2025 01:42 AM
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:
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2025 02:16 AM
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.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader