The Zurich release has arrived! Interested in new features and functionalities? Click here for more

How do i hide variables on a catalog item depending on a selection of another variable.

abcmh
Giga Contributor

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,

31 REPLIES 31

Madhu27
Tera Expert

Please post your main catalog item display also. would like to see how your variables looks like at initial load.


reginabautista
Kilo Sage

Hmm looks good to me. One thing I could think of is if there are conflicts or multiple UI Policies for   those fields the policy wouldn't work. Can you open each of the fields in the UI Policy actions and see if there are any conflicts. Something like this:


find_real_file.png


I double checked and did not find multiple Ui policies for those fields.


abcmh
Giga Contributor

This is the main catalog display when i TryIt. When i select New Contract, only then it should display the dates and description , comments field. So right now i have not selected new Contract but the fields are still visible.



find_real_file.png


Hi Amol,


Please use this onChange script,



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);


  }


}