Issue
After setting the g_form.setSectionDisplay
function to 'false' in a client script, it does not hide the form section on page load.
g_form.setSectionDisplay('<section_name>', false);
Release
.
Cause
There could be two causes for this:
- The setSectionDisplay function not working properly is due to how the section name is used within the function.
- There are mandatory fields within the section that is being hidden.
Resolution
For #1
As per the documentation on setSectionDisplay, the section name is in lowercase with an underscore replacing the first space in the name, and with the remaining spaces being removed.
For example:
"Section Four is Here" becomes "section_fourishere".
Other non-alphanumeric characters, such as ampersand (&), are removed.
**Section names can be found by using the getSectionNames() method.
For #2
It is expected behavior that if there are empty mandatory fields within the section being hidden the section itself will not be hidden. The reason is that users won't be able to see which mandatory fields to fill out if the section that contains them is hidden. If all mandatory fields have values then the section will hidden.
*note - In workspace forms, there was a defect where if the section contained any mandatory field, the section would not be hidden, even if the mandatory field had a value. The was resolved in Y release to match the UI16 behavior.