How   to make mandatory and non-mandatory based on field value .

Pramod5
Tera Contributor

How   to make mandatory and non-mandatory based on field value .

 

Pramod5_0-1698328537285.png

if ZooX PN and MFG PN fields having some value then below fields should mandatory otherwise non-mandatory 

How we can achieve this ?

 

Thanks 

1 ACCEPTED SOLUTION

Vanderlei
Mega Sage

Hi @Pramod5, you can avoid code and try UI Policie

Vanderlei_0-1698330340954.png

If my answer helped you, please mark my answer as helpful.

 

Vanderlei Catione Junior | LinkedIn

Senior ServicePortal Developer / TechLead at The Cloud People

View solution in original post

4 REPLIES 4

Peter Bodelier
Giga Sage

Hi @Pramod5 

 

What are we looking at here?
Catalog item, table, something else?

 

Normally you could just use UI Policies to do what you need?
Have you tried that, what issues are you running into?


Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

Samaksh Wani
Giga Sage
Giga Sage

Hello @Pramod5 

 

You need to use onLoad Client Script :-

 

function onLoad(){

var a = g_form.getValue('ZooX PN field name');
var b = g_form.getValue('MFG PN field name');

if(a != ' '&& b!=' ' ){
g_form.setMandatory('Quantity Needed field name', true); // fields which you want to make mandatory
}


}

 

 

Plz mark my solution as Accept, If you find it helpful.

 

Regards,

Samaksh

Samaksh Wani
Giga Sage
Giga Sage

Hello @Pramod5 

 

If you find my response as Helpful, Plz mark the solution as Accept. It will help the future members.

 

Regards,

Samaksh

 

 

Vanderlei
Mega Sage

Hi @Pramod5, you can avoid code and try UI Policie

Vanderlei_0-1698330340954.png

If my answer helped you, please mark my answer as helpful.

 

Vanderlei Catione Junior | LinkedIn

Senior ServicePortal Developer / TechLead at The Cloud People