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

Hi,

If you place code in that if then it will work only at the time of form load.

 

@prerana

Check onChange client script UI type, make sure it should be All.

Thanks,

Dhananjay.

Yes, the ui type was mismatched and it works fine now.

Hi,

Glad it helped you.

Have a nice day, And keep learning.

Thanks,

Dhananjay.

Jude S
Tera Contributor

I had the same issue recently where the g_form.showFieldMsg(..) was not displaying the message on portal.
I have found that if you try to clear the value using  g_form.clearValue(..) straight after the g_form.showFieldMsg(..) it will not display the error message.

Instead clear the value prior to displaying the error message.

 

This does not work!

g_form.showFieldMsg('contract_end_date','Pleaase select a date which is in the future.','error');
g_form.clearValue('contract_end_date');


Solution

g_form.clearValue('contract_end_date');
g_form.showFieldMsg('contract_end_date','Pleaase select a date which is in the future.','error');

 

 

 

Thank you 🙂