Displaying Field Message For Variables in the Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2015 10:18 PM
I would like to set a Field Message on a catalog variable.
However I am not having any luck doing so.
I am able to get the value, set mandatory, visiblity.
I tried what was posted in the following link:
How to display error message next to a variable in the Service Catalog
Here is my code in the Catalog Client Script:
function onSubmit() {
//Type appropriate comment here, and begin script below
var assetInStock = g_form.getValue('asset_in_stock');
alert ("asset in stock: " + assetInStock);
g_form.showFieldMsg('asset_in_stock',"... Asset in Stock Message",'error');
return false;
}
Does anyone have any other suggestions?
Regards,
Mike
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-24-2015 08:51 AM
I don't see anything wrong with the script. Just to be sure, is the variable name "asset_in_stock" correct? Does the alert function return correct value?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-24-2015 10:13 AM
Probir,
Yup, the variable returns a proper value...
Regards,
Mike
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-27-2015 01:34 PM
try changing the message to just test.. i am worried about control characters in your message text...
also i tend to put these in a policy... set the conditions when it should appear in the true box.. then set a clear message in the false...