UI Policy not triggering when the field is cleared by another Client script

kailashthiyagar
Kilo Guru

I have field A and when I select the value of 'Yes', it will make another field B as Editable else the field B will be disabled. It works fine through UI policy.

Now I have field C and on changing value in Field C, Field A will be cleared. If suppose the previously selected value in Field A is 'Yes', then Field B also will be editable. On clearing the value in Field A, the expected behavior is, UI policy should be executed so that field B will be disabled. But now field B will remain editable

Should I be writing logic again my Field C client script to take care of the original logic? I can do it but field C already have 3 choices and have plenty of logic in it. Including this as well over there will make things complicated.

1 ACCEPTED SOLUTION

HI Please find the below



Ui Policy:



find_real_file.png



Onchange Client Script:



find_real_file.png




Initially When loadin the form:



find_real_file.png



When test 1 is yes test 2 is ediatbale:



find_real_file.png



when test3 is selected as yes, Test 1 is None and Test 2 is readonly.




find_real_file.png



Please let me know if this helps you.



mark Correct if this helps you.


View solution in original post

12 REPLIES 12

HI Kailash,



Please check the record in your Instance. Its working.



Thanks


explorenow ursnani sanjivmeher





Thanks a lot ursnani . I have noticed that the client script is modified to get executed only when the newvalue is true. Another important thing which i noticed is, if we use g_form.setValue('fieldname',''); then only UI policy getting triggered and if we use g_form.clearValue('fieldname'), UI policy not getting triggered. This is the actual source of issue in my original code in my dev instance.. Thanks a lot .


Yes, Kailash by using   ClearValue() you are not setting the value of the Field, so the UI is not getting triggered, But when we use setValue() we are setting the value of field so UI Policy is triggered.



Please mark my answer as Correct if this solves your Issue.



The screen shots which i have replied are the same.