g_form.showFieldMsg not working

alex_tan
Kilo Contributor

Hi All,

I am encountering an issue now where g_form.showFieldMsg("field name","error message","error") is not loading error message in London Service Portal for a onChange Catalog Item client script.

Would like to seek advice on this issue.

Thanks a lot for your help!

28 REPLIES 28

Harsh Vardhan
Giga Patron

can you paste your full script?

 

adding thread here. kindly refer that.

 

https://community.servicenow.com/community?id=community_question&sys_id=e7828721dbd8dbc01dcaf3231f96...

Could younhelp on this scenario

Here am getting alert msg but g_form msg not triggering 

if (!/^[a-z]+$/.test(newValue))
///^[0-9*#+]+$/

{
alert(" name should be lower case ");
g_form.showErrorBox('u_name', 'name should be lower case',false);
g_form.showFieldMsg('u_name', 'name should be lower case','info',false);
g_form.clearValue('u_name');
}

try Clearing the value first and then display error message then it will work. try in this format.

 

g_form.clearValue('u_name');

g_form.showFieldMsg('u_name', 'name should be lower case', 'info');

 

moving clearValue before showFieldMsg fixed my problem, thanks heaps