Clear Field Message

Rakshanda Kunte
Tera Contributor

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.

1 ACCEPTED SOLUTION

@Rakshanda Kunte 

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');
}

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

View solution in original post

7 REPLIES 7

@Ankur Bawiskar 

Got it. Thank you..!!

shubhamdubey
Mega Sage

Hi @Rakshanda Kunte 

 

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

}

Amit Gujarathi
Giga Sage
Giga Sage

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