How do i hide variables on a catalog item depending on a selection of another variable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2017 12:17 PM
I have a Service Catalog item that i am working on . I am adding variables to this item which are checkboxes, radio buttons, multivalue drop down selections, text values, date items etc.
If i select a particular check box like "New Contract" , i need to display a couple of date variables and a comments variable.
What is the best way to achieve this ? Any suggestions?
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-27-2017 09:20 AM
Write a onChange client script
ncChange of : new Contract
Try this script
script:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading ) {
g_form.setDisplay('<fieldname1>',false);
g_form.setDisplay('<fieldname2>',false);
g_form.setDisplay('<fieldname3>',false);
return;
}
if (newValue == 'true'){
g_form.setDisplay('<fieldname1>',true);
g_form.setDisplay('<fieldname2>',true);
g_form.setDisplay('<fieldname3>',true);
}
else{
g_form.setDisplay('<fieldname1>',false);
g_form.setDisplay('<fieldname2>',false);
g_form.setDisplay('<fieldname3>',false);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-27-2017 09:13 AM
Hi Amol, Please hide all these 3 fields while loading as follows in a separate UI policy.
Contract Start Date visible = false, Mandatory = leave alone, Read only = leave alone
End Date visible = false, Mandatory = leave alone, Read only = leave alone
Comments visible = false, Mandatory = leave alone, Read only = leave alone
If it does not work please send your main catalog item image and your UI policy.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-27-2017 09:28 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-27-2017 09:49 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-27-2017 09:58 AM
Use my script or regina suggested. you do not need to write 2 ui policied like onLoad and change.