- 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 08:55 PM
onChange script didn't work either on portal (it worked on the form in servicenow but not on portal)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā09-07-2018 08:59 PM
Are you still seeing the message appear briefly before it's gone?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā09-07-2018 09:01 PM
for a fraction of a second when i refresh the portal page. is there any other workaround then Show message? can i display a text but it can't be a pop up message or message on the top of the page (gs messages)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā09-07-2018 09:05 PM
You can do a form message on top of the form or an annotation next to the field, but I don't think those will work for what you want to do. The annotation doesn't require any scripting, but will always be shown. The form message won't show next to the field.
Are there any other client scripts or UI policies that are running that you could turn off temporarily to see if they are conflicting with or overriding the behavior of this script?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā09-07-2018 09:08 PM
Also, can you post a screenshot of your client script?