- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2018 12:28 PM
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
Solved! Go to Solution.
- Labels:
-
Incident Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2018 12:47 PM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2018 12:36 PM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2018 12:47 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2018 01:03 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2022 10:15 AM