- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2020 11:29 PM
How to hide mandatory variable in catalog item. This variable is mandatory in variable set
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-22-2020 01:33 AM
It is working with UI Policy with condition Mandatory, visible, read only to false.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2020 11:43 PM
Hello,
You can use catalog client script
Applies to: Variable Set
Applies on a Catalog Item view: checked
Applies on Requested Items: checked
Applies on Catalog Tasks: checked
Script:
function onLoad() {
try{
g_form.setMandatory("variables.Ship_to", false);
g_form.setDisplay("variables.Ship_to", false);
} catch(err) {}
}
Please Mark it as helpful/Correct if it help you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-22-2020 12:07 AM
I tried the below onload script but not working
function onLoad() {
try{
g_form.setMandatory('u_environment_catalog', false);
g_form.setDisplay('u_environment_catalog', false);
}
catch(err){}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2020 11:50 PM
You cannot hide a mandatory variable.
In your client script, first set it to not be mandatory and then hide.
Create an onLoad Catalog client script like this:
replace <variable name> with your variable name.
function onLoad(control, oldValue, newValue, isLoading) {
g_form.setMandatory("<variable name>", false);
g_form.setDisplay("<variable name>", false);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-22-2020 12:10 AM
I tried the below script but not working
function onLoad() {
try{
g_form.setMandatory('u_environment_catalog', false);
g_form.setDisplay('u_environment_catalog', false);
}
catch(err){}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-22-2020 12:12 AM
Use this:
function onLoad(control, oldValue, newValue, isLoading) {
g_form.setMandatory("u_environment_catalog", false);
g_form.setVisible("u_environment_catalog", false);
}