How to hide mandatory fields

Saridha_L1
Tera Expert

Hi Team,

I am unable to hide the mandatory field using UI Policy. Because there is a variable set ,using the same field for 5 different items. can anyone help me

Regards,

Saridha.L

1 ACCEPTED SOLUTION

Shishir Srivast
Mega Sage

As other suggested UI Policy is good option where you can select the particular catalog item and then based upon variable value changes you can to set the field behavior. You can build the condition. I think when you are selecting the Catalog item then it should not impact other catalog item if they are referring the same variable set.



find_real_file.png


if there is any issue with UI Policy then give a try with catalog client script if that helps. Simple Sample Script (change the field_name accordingly)



function onChange(control, oldValue, newValue, isLoading) {


if (isLoading || newValue == '') {


return;


}


if(newValue == 'PUT THE FIELD VALUE HERE'){


g_form.setMandatory('field_name', false);


g_form.setDisplay('field_name', false);


}


else{


g_form.setMandatory('field_name', true);


g_form.setDisplay('field_name', true);


}


}


View solution in original post

12 REPLIES 12

Harsh Vardhan
Giga Patron

have you tried to pass higher order in your ui policy ?


Harsh Vardhan
Giga Patron

Note:   If there is a mandatory field you cant make it hide it, so before you have to hide you make the field non mandatory.


Thank you for your response.



I have made it non mandatory, but it didnt work.


is that form or catalog form? have you defined higher order? kindly share the screenshot