- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2018 07:57 PM
UI Type= All. Below script works fine in servicenow(Kingston) but it's not working on portal. Field message does display on portal for a split second though . Any suggestions guys Thanks
function onLoad() {
var WTest = g_form.getValue('u_w_status');
if ( WTest== 'Awaiting') {
// alert('What');
g_form.showFieldMsg('WTest','Disclaimer .........' , 'info' , true);
}
}
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-24-2018 08:31 AM
the info,true works great for me. Are you remembering to hide the message also if it's false.
Here is an example of my script and it works great on the portal.
function onChange(control, oldValue, newValue, isLoading) {
// if (isLoading || newValue == 'prod') {
if (g_form.getValue('var_environment') == 'prod'){
g_form.showFieldMsg('var_environment', 'INFORMATION: Sandman will not run against this environment','info',true);
}
else{
g_form.hideFieldMsg('var_environment');
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2018 09:14 PM
I tried annotation but you are right it won't work or other form messages. it's working fine in ServiceNow but not on portal which is strange. if there was any error in client script it shouldn't work at all
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2018 08:25 PM
standard form (sys_approval)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-24-2018 08:31 AM
the info,true works great for me. Are you remembering to hide the message also if it's false.
Here is an example of my script and it works great on the portal.
function onChange(control, oldValue, newValue, isLoading) {
// if (isLoading || newValue == 'prod') {
if (g_form.getValue('var_environment') == 'prod'){
g_form.showFieldMsg('var_environment', 'INFORMATION: Sandman will not run against this environment','info',true);
}
else{
g_form.hideFieldMsg('var_environment');
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2019 06:00 AM
I had the same issue recently where the g_form.showFieldMsg(..) was not displaying the message on portal.
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
10-06-2022 05:02 AM
it is still not working. even alert pop up is also not visible in portal. however in try it it is getting displayed. I think there is some settings we need to do for portal side.