Catalog Item Variable

yoli1
Tera Contributor

Hello Team so i created a Catalog UI policy to hide a field but i want when the field is visible again to make it Mandatory is this possible ?

8 REPLIES 8

Pradeep19
Tera Contributor

Yes, this is possible when you want to hide make mandatory false and click on reverse if false, so when field is visible then field also become mandatory..

Abhishek_Chavan
Tera Expert

You can make the variable mandatory and visible by default. Then using UI policy reverse the changes i.e. mark it non mandatory, hide it that should meet your requirement.

Rhodri
Tera Guru

Yes this is possible, by default you when you make a variable mandatory it will become visible anyway.

 

Rather than using a UI policy to hide your variable, there is a field called "Hidden" on the variable record (you can add this to the column layout or onto the form if you don't have it). This way you only need the one UI policy (the one that you are using to make mandatory/visible) 🙂

Rhodri_0-1694081091729.png

 

 

EDIT:

Apologies I've reread your question and wonder if you want to make the variable mandatory after it becomes visible (separately). I would use a UI policy to do both instead - but I think you could do that with a catalog client script, there's a function g_form.isVisible() and the g_form.setMandatory();

yoli1
Tera Contributor

@Rhodri So backstory i have a filed called region and a field called country. in my UI policy if the region is empty then  Hide the field country. so what i want is when country if visible after the user put a value in region is to make country also mandatory