- 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 08:19 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-03-2016 11:34 PM
Hi Mussie,
Try clicking on advance view. This should bring all the fields on form.
Then check the one which says 'Applies on Requested Item'. That should of the trick.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-06-2016 02:56 PM
Any idea why this isn't working for me? The sys_id for the specific catalog item is correct and I have got a variable with the name firstName on the item.
function onLoad() {
//Type appropriate comment here, and begin script below
if (g_form.getValue('cat_item') == 'a3a616826f8721000ad98bc44b3ee462'){
g_form.Mandatory('variables.firstName', false);
g_form.setDisplay('variables.firstName', false);
}
}
Mussie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-06-2016 07:08 PM
From what I can see, if you are using the exact same script there is a syntax error:
g_form.Mandatory('variables.firstName', false);
should be
g_form.setMandatory('variables.firstName', false);
Also, I don't think that you need to use "variables.variable_name" in catalog client scripts. you can try just the variable name.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-06-2016 07:45 PM
Thank Mayank, I don't know how I missed it, that solves part of my problem. I need to put a variables.variable_name though. Do you know how I can hide all the variables without specifying the each and every variable? I've got more than 50 variables and this makes it really tedious to list all in the code.
Mussie