showFieldMsg in client script not showing in red color for type "error" in Employee Center
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2025 10:19 PM
In Employee center,
For one of the catalog item, I have a client script such as when some conditions are met error message should be shown.
This is the script I tried in my PDI
Im expecting to see the error message in red color, but its simply a text without any color highlights
When I try the same in native view, its working as expected
Can someone help me understand what is the issue here?
I experienced this issue in my client insatnce and I tried to replicate the same in my PDI and results are same. The error type is not highlighted in RED.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2025 10:33 PM
Use g_form.addErrorMessage() (Top-of-form message)
If you don’t need it tied to a specific field, this is the most reliable for red error messages:
This appears in red and is fully supported in Employee Center and Service Portal.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2025 10:35 PM
You’re using something like this:
But in Employee Center, this doesn't show in red or doesn't render as expected.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2025 11:30 PM
Hi @Service_RNow , Thank you for your reply.
But I dont understand why its not supported in Employee center.
Is it a known bug or something?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2025 11:16 PM
@Sruthi17
Not a classic form: The Employee Center uses different rendering technology, often based on Service Portal widgets or Now Experience components, which do not include g_form or GlideForm-based rendering.
Use g_form.addErrorMessage() (Top-of-form message)
If you don’t need it tied to a specific field, this is the most reliable for red error messages:
This appears in red and is fully supported in Employee Center and Service Portal.
Please mark reply as Helpful/Correct, if applicable. Thanks!
