- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2014 06:44 AM
When I try to use
g_form.flash('sc_cat_item.ci_name','#FF0000',-4);
from a catalog client script, I get the following error
The documentation for g_form flash states the the widget name should be in the form <table name>.<field name>
I have tried:
g_form.flash('sc_cat_item.variables.ci_name','#FF0000',-4);
g_form.flash('variables.ci_name','#FF0000',-4);
g_form.flash('sc_cat_item.ci_name','#FF0000',-4);
g_form.flash('ci_name','#FF0000',-4);
Is there no way to make a field flash on a service catalog form?
Solved! Go to Solution.
- Labels:
-
Service Mapping
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2014 07:43 AM
Hi Trey,
I was able to apply g_form.flash to service catalog variables by first inspecting the element I want using Firebug in Firefox and locating the label_IO sys_id. then use that in place of the variable name in the script.
For an onLoad example:
function onLoad() {
g_form.flash('label_IO:33586fd4ad054100872edb6647c09400',"#CC0000", -2);
}
You just need the correct label_IO and associated sys_id which you can copy out of Firebug and you should be good.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2014 07:43 AM
Hi Trey,
I was able to apply g_form.flash to service catalog variables by first inspecting the element I want using Firebug in Firefox and locating the label_IO sys_id. then use that in place of the variable name in the script.
For an onLoad example:
function onLoad() {
g_form.flash('label_IO:33586fd4ad054100872edb6647c09400',"#CC0000", -2);
}
You just need the correct label_IO and associated sys_id which you can copy out of Firebug and you should be good.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2014 09:12 AM
Thank you for the quick answer, Matthew. I had already tried.
g_form.flash('IO:<var sys id>','#FF0000',-4);
But I did not know to pre-pend "label_".
Thanks for sharing this tip!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2015 10:50 AM
I realize this is a little bit older post but I think others will find it. One additional recommendation to avoid hard coding any sys_ids is to utilize the getControl() function.
var myElement = g_form.getControl('variable_name');
g_form.flash("label_" + myElement.id, "#FFFACD", 0);
This way you're relying on a ServiceNow function to get the correct element id.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2015 12:24 PM
We upgraded to Fuji and came to know this type of code is working fine in Eureka but not in Fuji, Can you anyone give me an idea how to make it work in Fuji
Thanks,
Sri.