- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2023 03:34 AM
Hi All,
How can we remove the message that we created with "g_form.showFieldMsg"?
I need to perform same action which we perform with "g_form.clearMessages()".
Thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2023 05:22 AM
just want to inform that you need to use sysId for department since it's reference variable
var a = g_form.getValue('department');
if (a == 'it_demoSysId') {
g_form.showFieldMsg('type_1', 'Note: This is info message');
}
else if (a == 'cse_demoSysId')
{
g_form.hideFieldMsg('type_1');
}
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2023 03:46 AM
if you want to hide field message use
g_form.hideFieldMsg(<field_name>);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2023 03:54 AM
you need to use g_form.hideFieldMsg
what script did you try and what's not working?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2023 05:08 AM
Hi @Ankur Bawiskar ,
Issue: once I select CSE in department, I do not want to see message "Note : This is info message".
Script:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2023 05:22 AM
just want to inform that you need to use sysId for department since it's reference variable
var a = g_form.getValue('department');
if (a == 'it_demoSysId') {
g_form.showFieldMsg('type_1', 'Note: This is info message');
}
else if (a == 'cse_demoSysId')
{
g_form.hideFieldMsg('type_1');
}
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader