How to make worknotes mandatory if priority changes

asham2
Kilo Contributor

Hi...

I have to make the "work notes" field mandatory if the "priority" field   changes, I have achieved this through "client script" but i need to achieve this using UI policy

Through UI policy what is the condition or script to be used ?

Can anyone help to achieve this?

8 REPLIES 8

amlanpal
Kilo Sage

Hi Asha,



Client script is the best way to achieve this requirement. UI Policy will work like onChange Client Script only there is the condition set as 'Priority' is '1-Critical' or something like that. Once you change the value of the priority field to '1-Critical' the UI policy will run and the defined UI Policy Actions will be applied.


Better I would suggest you to carry on with the Client Script. Please find the relevant discussions on the same topic below.


1. Will a UI Policy's 'Execute if true' script only run at load time? It doesn't seem to run whenever t...


2. Executing UI Policy on text field change



I hope this helps.Please mark correct/helpful based on impact


Atul Kumar2
Giga Guru

Hi Asha,



You can write a client script or ui policy will also do.



OnChange of client script.



function onChange()


{



if(g_form.getValue('Priority')==5)


{



g_form.setMandatory('work_notes',true);


}


else


{


return false;


}


You will have to check the exact function name since i just typed it on screen but logic will do work.



Hope this helps you.



Regards,


Atul Kumar


nitish99
Tera Guru

Hi Asha,



You have to write an onChange Client Script for your requirement as follows-:



find_real_file.png