Displaying Field Message For Variables in the Catalog

michaelrodway
Tera Contributor

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

7 REPLIES 7

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Michael,



I've just tried on below demo instance and it works fine.


https://demo005.service-now.com/login.do


Username : admin


Password : admin


Steps to test : go to catalog item->access->click try it



Please let me know if you have any questions.


Pradeep, I didn't see what you did in the demo environment, however I was able to replicate it. And Yes it does work... thanks.



However, it still doesn't work in our instance. We are running Eureka (vs. Fuji in the demo instances). Not sure if that should make a difference?



Mike


Hi Michael,



I've tried this on Eureka too and it works. Can you try to create a new test catalog item in your instance and check if this issue replicates for all or is it for only one catalog item.


If you still face issues, I would recommend you to raise a HI ticket.


OK thank you for your help.