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

Jyoti Jadhav9
Tera Guru

Hi @WITOU ,

 

Please try the below condition:

var 1 is one of X, Y && var 2 is X

It should solve the issue.

 

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

 

                         

 

Hi @Jyoti Jadhav9 ,

 

Thank's for your reply!

 

This is exaclty what I did but it didn't work.

 

 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.

 

Could you help me please!

 

Thank you, 

Hi @WITOU ,

 

What functionality is written in ClientScript? What is the usecase?

If you are using g_form.clearOptions ( "var 2 " ) in client script then in UI policy condition will be failed. 

 

Please try below statement:

g_form.setValue("var2", "");

 

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

 

 

Regards

Jyoti Jadhav

Hi @Jyoti Jadhav9 ,

 

Please find below the client script:

 

function onChange(control, oldValue, newValue, isLoading) {
   if (isLoading || newValue == '') {
    g_form.clearOptions('var2');
    g_form.addOption('var2','','None');
      return;
   }

// Comment
 
if(newValue=='X'|| newValue=='Y' )
{
    g_form.clearOptions('var2');
    g_form.addOption('var2','','None');
    g_form.addOption('var2','Creation','Creation');
    g_form.addOption('var2','Modification','Modification');
 
Thank you ,