Catalog Client Script Not Working Correctly Against RITM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-14-2020 06:21 AM
We have come across some great code that we use in a Catalog Client Script in a Catalog Item that allows us to change the label of a variable in the Catalog Item based on the entries from other variables in the same Catalog Item.
The Catalog Client Script looks like this:
So based on the value selected in the "Request Type" field, it determines which label to use for the "Name" field.
It works perfectly on the Catalog Item on the Service Portal. An example looks like this:
You can see, as "New SharePoint site" is selected as the Request type, it shows the "Please provide the name of the SharePoint site you would like to be created:" in the label of the next field.
So it works great on the Catalog Item on the Service Portal. However, even though the Catalog Client Script has the "Applies on Requested Items" check box checked, it does not seem to work when viewing the submitted request from within ServiceNow. If I bring up the Requested Item in ServiceNow, this is what I see in the Variables section:
As you can see, the description erroneously says "Please provide the name of the team you would like created" instead of the "Please provide the name of the SharePoint site you would like to be created:" text.
Why is this not being to the RITM from within ServiceNow?
Does it have someting to do with it being in the "Variables" section?
How can I get this to work properly?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-14-2020 11:43 AM
Yes, I noticed that. I don't think we want it "onLoad" for the Catalog Item, as the value is dependent on the value of another field that gets updated. So I think that one would need to be an "onChange". However, by the time it gets to the RITM, it is just reporting on what has already been filled out. So that one may be an "onLoad".
On top of that, the "request_type" is actually filled out on the Order Guide level, while the other field is on the Catalog Item (though I do have the same field from the Order Guide on the Catalog Item, being cascaded down and hidden).
This could get a little tricky...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-14-2020 11:56 AM
Yes, you will need onload function to work only on Requested Item and catalog Task not on catalog item form.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-14-2020 11:58 AM
I have not brought up the Catalog Task at all. I am talking about when you are populating the form on the Service Portal for the first part (hence, the Catalog Item, where the variable actually lives).