
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2015 02:46 PM
I have a variable set: Contact Info that is applied to every item in my service catalog. I have a variable within this set called Ship_to. I only want Ship_to to be visible and mandatory if the items billable(sc_cat_item_billable) flag is true.
I have tried multiple client scripts and UI policies but have not gotten any to work yet. Has anyone been able to accomplish this before?
Thanks,
Teri
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2015 09:36 PM
This may sound a little odd, but it works. I'm assuming here that "Ship_to" is visible and mandatory by default.
1. Create a new Variable Set called "Hide Ship To" (or whatever)
2. Create a new "onLoad" Client Script with the following settings:
Applies to: Variable Set
Variable set: Hide Ship To
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) {}
}
Add the new Variable Set to each Catalog Item where you want the field hidden. No actual Variables are required in the Variable Set.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-09-2015 08:46 AM
You are welcome!