g_form.showErrorBox and showFieldMsg do not work at Service Portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2018 11:36 AM
Hi all
the onLoad Client Script with g_form.showErrorBox or g_form.showFieldMsg do not work in Service Portal.
function onLoad() {
var msg = 'check at lease one checkbox';
if(g_form.getValue("add_user", false)){
g_form.showErrorBox('right', msg);
}
}
This script work on CMS but not on Service Portal
Please Help!!!
Thank you

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2018 11:57 AM
Maybe failing as getValue doesn't take two parameters.
The methods on the portal seem to be more strict. Another thing would be to check for errors in your console, and disable other client scripts.
Try this;
function onLoad() {
var msg = 'check at lease one checkbox';
if(g_form.getValue("add_user")){
g_form.showErrorBox('right', msg);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2018 12:10 PM
"add_user" is a checkbox variable
function onLoad() {
var msg = 'check at lease one checkbox';
var x = g_form.getValue("add_user");
if(x == 'false'){
g_form.showErrorBox('right', msg);
}
}
does not work either
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2018 12:36 PM
Is your catalog client script's UI Type is set to All ?
Please mark my response as correct and helpful if it helped solved your question.
-Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2018 12:41 PM
Yes