Order guide client script to hide variable of catalog items without any changes to main catalog item

jay_15
Tera Contributor

Hello,

 

I have multiple catalog items that are requestable individually and combined as order guide. 

 

I need to hide/read-only) specific variables from the catalog items (Requested For) which is selected once as order guide variable.

 

There are multiple catalog items and hence is there any approach where in the Order guide I can access the form variables of constituent catalog items and perform operations on them like hide/read-only.

 

Something like,

Pseudo Code.

catalogItems = orderGuide.getConsitituentForms(CatalogItems)()

gform = catalogItems[1].setReadOnly('variableName')

 

Thanks,

Jaydeep Mehta

1 REPLY 1

Mikael Karlsson
Kilo Sage

One of the benefits of order guide is that the fulfillment can be done on individual RITMs just as if they were submitted separately. So ideally they should look just like if they were submitted separately.

You should only be required to supply a variable once if a variable with the same name exists in the Order Guide and it's set to Cascade Variables.

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0521196

 

Otherwise, if you have control over the other catalog items, perhaps it's possible to introduce some kind of hidden variable which gets cascaded to from the order guide, like "hideFieldPlease=true" and attempt to use that as a criteria within the catalog item for the hiding of another variable. 🙂