UI POLICY - SERVICE CATALOG "WHEN TO APPLY"

WITOU
Tera Contributor

Hello Everyone,

 

I need your help please, 

 

I would like to apply catalog UI POLICES with two variables ( select box).

 

When to apply:

 

If      var 1 is X

and  var 2 is X

OR

if     var 1 is Y 

 and var 2 is X

 

 

The UI policy  action:

 

The var 3 ( select box) should be visible.

 

This UI policy works only when I put one condition = var 1 is X, when I add the seconde one ( var 2 is X) it stops working.

 

Thank you in advance, 

10 REPLIES 10

@WITOU ,

 

Instead of UI policy, could you please try logic in client script and adjust the order of both client scripts.

 

If((g_form.getValue('var1') == 'X' || g_form.getValue('var1') == 'Y') &&(g_form.getValue('var2') == 'X')){

g_form.setDisplay('var 3', true);

}

 

Please hit the like button if my suggestion has helped you in any way.
Please mark correct if my response has solved your query.

 

Thanks & Regards

Jyoti Jadhav

pranita-24
Giga Guru

@WITOU 
Hi as per your requirement I have created one catalog UI policy.
There are three select box variables.
1. Class---> Options A]First year  B] Second Year
2. Division---->A] A B] B
3. Department---->A]Computer B] Electrical
Conditions-:
When Class is First year  and Division is A OR Class is Second year and Division is A 
Then Variable Department should be visible .
Below are some Screenshots.
INPUTS-:
1

pranita24_1-1707306327981.png

 

2.

pranita24_2-1707306365882.png

3. OUTPUTS-:

pranita24_3-1707306400232.png

 

pranita24_4-1707306432695.pngpranita24_5-1707306453994.pngpranita24_6-1707310347119.png

pranita24_7-1707310401559.png

 

You can try this I am sure it will help you to fulfill your requirement. 

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.

 

Best regards

Pranita

 

WITOU
Tera Contributor

Hi @pranita-24 ,

 

Thank you so much for your reply!

 

This is exactly what I did but it didn't work and it is  still not working 😞 

 

Thank you , 

WITOU
Tera Contributor

Hi @pranita-24 , 

 

It works only with the first variable. Once I add the seconde one ( division in your example), it stops working.

 

I want to highlight that the two variables are mandatory and the seconde variable depend on the first one ( I think this is why!) 

 

Thank you , 

WITOU
Tera Contributor

Hi @pranita-24 ,

 

I have concluded that the function "g_form.clearOptions ( "var 2 " ) "in a client script has an impact on the UI policy but I don't know how to fix it.

 

Thank you so much,