Set Choice field to None through UI policy if my condition fails

farci
Mega Expert

Hi Team,

I am unable to set a choice field as None when my condition fails. Below are the screenshots

find_real_file.png

Inline image 1

Inline image 2

Execute if true

function onCondition() {

  if(g_form.getValue('legends') == 'Between Expected & Minimum Target')

  g_form.setValue('d_type','Expected Default');

  if(g_form.getValue('legends') == 'Less than Minimum Target')

        g_form.setValue('d_type','Minimum Default');

  }

Execute if false

function onCondition() {

  g_form.clearValue('d_type');

  }

-------------------------------------------------------------------------------------------------------------------

In execute if False,

I tried all options to set this value as '--None--'

but it did not worked.

In my legends

Thank You for your support and help.

Regards,

Narmi

1 ACCEPTED SOLUTION

Kalaiarasan Pus
Giga Sage

Instead of 'or' in the condition, add 'And' instead.


View solution in original post

5 REPLIES 5

farci
Mega Expert

Attached are the screenshots




find_real_file.pngfind_real_file.png


Regards,


Narmi


Hi Narmi,



Look at the condition. Its always gonna execute to TRUE, no matter what !!!.



Thanks


Srinivas


Use 'is not one of' condition instead of two not condition this will always evaluate to true.


Mark Correct if it solved your issue or hit Like and Helpful if you find my response worthy.


Kalaiarasan Pus
Giga Sage

Instead of 'or' in the condition, add 'And' instead.