g_form.showFieldMsg not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2018 08:01 PM
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!
- Labels:
-
Service Portal Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2020 01:10 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2020 02:48 AM
Yes, the ui type was mismatched and it works fine now.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2020 03:09 AM
Hi,
Glad it helped you.
Have a nice day, And keep learning.
Thanks,
Dhananjay.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2019 05:51 AM
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');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2020 02:41 AM
Thank you 🙂