Ui policy or something else?

B_pppppp
Tera Contributor

I need to check if a field has no value available to choose from. If the field has no value, another fields needs to be mandatory. Can I do this in ui policy? How?

13 REPLIES 13

Hi @B_pppppp ,

 

You need to locate the script that gives specific users no option to chose at the desired field. Afterwards look at the condition why there is no option to chose etc.

 

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

 

Best regards

Anders

 

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

Best regards
Anders

Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/

KagawadePraveen
Tera Contributor

 Give more information about the requirement.

Explain the problem you are facing in detail, so that we (Community) can help you..

dpac_nick
Tera Contributor

Hi @B_pppppp  

I don't think it is possible with UI Policy, but I would suggest a workaround with onLoad Client Script. Refer below sample code: 

function onLoad() {
   var fieldObj = g_form.getControl("field_name"); // get field element
   if (fieldObj.options.length != 1) {
		g_form.setMandatory("mandatory_field_name", true); // for making field manadatory
   }
}

Hope this help!

If this works for you, please mark my answer correct or helpful.

thank you but it's not working

vamsi krishna8
Tera Contributor

Correct my understanding , " if the one of the field value is Empty then u need to make the other field mandatory !".
if it is the above case then u can use UI policy for the requirement.