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

It is not working for me for the info message display at the portal.
But working fine if i choose error to the below.
Can you help me out for the info message display at the portal level ?

Raj68
Mega Guru

Hi Alex,

try below code hope it will help you:

g_form.showFieldMsg('display_name', 'USA timezone is different','info',true);

 

NOTE: Mark correct or helpful if it helps you.

 

Warm Regards,

Raj patel

 

snehalkhare
Kilo Guru

Hi Alex,

 

I was facing the same issue. The showFieldMsg does not work in onchange client script. Try out the same script inside   if (isLoading || newValue == '') {'Your script to show the msg'}

 

Thanks,

Snehal K

Hello Snehal,

I am also facing the same issue, did you get the workaround for this if so please suggest me.

Below is my code 

function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}

if(g_form.getValue('urjency')=='high'){
g_form.showFieldMsg('urjency','Please log a call to service desk to report very urjent issue','info', false);
}
else{
g_form.hideFieldMsg('urjency');
}

it works great in platform view but doesnot work at all in service portal.

 

Thanks and Regards,

Bhavana

Hi,

Try adding you script inside

 if (isLoading || newValue == ''){

// YOUR SCRIPT 

 

}

 

Regards,

Snehal