- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-03-2016 04:15 PM
Hi Guys,
I have got a requirement where I need to hide variables from displaying on sc_req_item form. The requirement are as follows:
- Hide all variables from displaying from some catalog items on Request Item (sc_req_item) form
- Hide some variables from displaying from some catalog items on Request Item (sc_req_item) form
Could you please suggest on how I can achieve this? I am new to the product so please be detailed in your answers.
Thank you,
Mussie
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-07-2016 06:02 PM
Hi Mussie,
You can use variable set for your variables.
Then you can hide the variable set using g_form.setDisplay('variable_set_name',false); in the catalog client script
Don't Forget to tick the applies to requested items.
Thanks,
Tadz

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-03-2016 04:18 PM
Hi Mussie,
You can use g_form.setDisplay('variables.VAIRBALENAME, false); to hide the catalog variables on the form.
Please refer the below blog and adjust your code as per req
http://www.servicenowguru.com/scripting/business-rules-scripting/hide-empty-variables-standard-form/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-03-2016 04:26 PM
Thanks for your quick reply. You addressed only the first part of my question, I take it that it won't be possible to hide all, is that correct? With regards to your answer, how do I identify the catalog items on which this should be applicable. For example, the catalog item that I need to hide some of this variables is 'a3a616826f8721000ad98bc44b3ee462'.
Mussie

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-03-2016 04:34 PM
Hi Mussie,
You can hide all the variables. In the thread I shared it hides all the empty variables on the form. It basically makes a loop and hides all the vars stored in scratchpad.
To answer your second question to run the script against a respective cat item, There is a field on "sc_req_item" table i.e item(cat_item) which you fetch the value at the client script side and validate to run it against respective item only.
At the BR side you can apply condition filter against "item(cat_item)" field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-03-2016 07:07 PM
Hi Mussie,
If you want to hide all variables on Requested Item form for some Catalog variables
And some variables for some Catalog Items,
The best way to do this in my opinion is using a Catalog UI Policy. Just tick the 'Applies on Requested Item' check-box.
This UI Policy is Catalog Item specific, so you can decide which variable sot hide for which Catalog Item.
Also, if the variables are generic or universal in nature you can create a variable set and attach the UI Policy to that variable set. So that the same set can be used in multiple Catalog Items. For more details please refer to following page:
http://wiki.servicenow.com/index.php?title=Service_Catalog_UI_Policy#gsc.tab=0
Thanks,
Mayank