I need to hide a variable on one item in an order guide

praveen47
Tera Contributor

Hi All, 

Need to hide one variable in catalog item if user selects from order guide. I have created a catalog item with 4 check box variables. 

1. Natural

2. Artificial

3. Add

4. Remove

 

If user submitting through seperate catalog item - If i check Natural check box display 'Add' & 'Remove' variable. 

If user submits from order guide - always needs to hide 'Add' variable if Natual check box checks it should display only 'Remove' option.

 

In catalog item i have added Ui policy and working as expected, In order guide this is choose option section is also displying 'Add' check box

 

for hiding i have written this on load script in item, but Ui policy is working after form loading. 

function onLoad() {
	var isOrderGuide = g_service_catalog.isOrderGuide();
	if(isOrderGuide){
		g_form.setDisplay('add', false);
		g_form.setDisplay('internal_user_group_ad', false);
	}
}

Can any one help me to get this functionality work as expceted

@Ankur Bawiskar 

3 REPLIES 3

shyamkumar VK
Kilo Patron

@praveen47 ,

Try this script

 

function onLoad() {



try {

 

          if($("sysparm_guide")) {

 

  return;

 

            }

 

        } catch(e) {

 

       

 

}

 

g_form.setDisplay('add’,false);// replace if variable name is incorrect 

 

Regards,

Shyamkumar



}

Please mark this as helpful and accept as a solution if this resolves your Ask.
Regards,

Shyamkumar

Sohail Khilji
Kilo Patron
Kilo Patron

Hi @praveen47 ,

 

Try this code ...

var isOrderGuide = g_orderguide.name();

if(isOrderGuide  == 'name_of_order_guide_here'){    //name of your order guide paste it.
g_form.setDisplay('add', false);
g_form.setDisplay('internal_user_group_ad', false);

}

or

if($("sysparm_guide")){

g_form.setDisplay('add', false);
g_form.setDisplay('internal_user_group_ad', false);

}

I hope this helps...

 


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect

Hi @Sohail Khilji , 

Thanks for reply, 

 

The script which is provided by is working If i display 'Add' variable directly in form. but 'Add' variable displaying only when we select natural check box. On checking of 'Natural' Variable still that is displaying. 

Is there any way to override Ui poclicy action on submitting through  Order guide