Hide Form Sections

Lohith
Giga Expert

Hi Team,

I want to hide form sections based on the condition.  we have created 2 form sections, both the form sections has certain fields, and fields with mandatory too. Now, when i try to hide the form section using g_form.setSectionDisplay('<form section name>', false), it is not hiding the form section.

If all the mandatory fields are filled in that section and tried to hide than it is successful, but why its not hiding when it has mandatory fields. I have made fields mandatory via UI Policy.

Appreciate your inputs.

Thanks,

Lohith

1 ACCEPTED SOLUTION

vinothkumar
Tera Guru

Yes, this is the expected behaviour. g_form.setSectionDisplay('<form section name>', false), will check whether is there any fields are mandatory, before hiding it.

 

Before hiding the section in the client script, you have to make the fields in the section as g_form.setMandatory('field_name', false); for all the fields in the section and then you have to add g_form.setSectionDisplay('section name', false); it will work

View solution in original post

8 REPLIES 8

Brian Lancaster
Tera Sage

If fields are mandatory on the form section it will not allow you to hide it as you would not be able to save the record.  You would have to make the fields not mandatory using the same criteria you are using to hid the form section.

vinothkumar
Tera Guru

Yes, this is the expected behaviour. g_form.setSectionDisplay('<form section name>', false), will check whether is there any fields are mandatory, before hiding it.

 

Before hiding the section in the client script, you have to make the fields in the section as g_form.setMandatory('field_name', false); for all the fields in the section and then you have to add g_form.setSectionDisplay('section name', false); it will work

Hi Vinoth, Got your point, can you help me to get all mandatory fields from that section? I mean is there any script which gives us all mandatory fields from form?

hey,

my fields are not mandatory still i am not able to hide the section. details section is not getting hide.

find_real_file.png

find_real_file.png

find_real_file.png