- 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 05:25 AM
Got it. Thank you..!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2023 04:01 AM
pls try this code
function onLoad() {
//Type appropriate comment here, and begin script below
var showMess = g_form.showFieldMsg('short_description' ,"test" );
var clr = g_form.hideFieldMsg('short_description');
regards
Shubham
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2023 04:33 AM
HI @Rakshanda Kunte ,
I trust you are doing great.
Please refer the below code for the same
function clearFieldMessage() {
// Hiding the message displayed on a specific field
g_form.hideFieldMsg('your_field_name');
}
Was this answer helpful?
Please consider marking it correct or helpful.
Your feedback helps us improve!
Thank you!
Regards,
Amit Gujrathi