- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2024 12:49 PM
How do you hide a form section? I've seen some saying to create a client script, but it's based of a specific condition. For example, if the value of this field is true, then hide the section. I don't have any conditions on hiding the section. I just want to hide it all together. Do I still need to create a client script? If so, what would the code look like?
Section name: Incident Management
Position: 7
Table: customer_account
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2024 01:09 PM - edited 06-04-2024 01:15 PM
Hi @MStritt Simply you can use onLoad Client Script on Account record/form and use below line of code
g_form.setSectionDisplay('incident_management', false);
Regards,
Sid
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2024 12:59 PM - edited 06-04-2024 01:06 PM
Hi @MStritt
To hide your sections is pretty simple. create your UI Policy and give condition like Value is True and make sure to check run Scripts. In your true/false sections add your code:
True:
function onCondition() {
g_form.setSectionDisplay('incident_management', true);
}
False:
function onCondition() {
g_form.setSectionDisplay('incident_management', false);
}
Please mark my answer Correct/Helpful
Regards,
Sid
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2024 01:06 PM
Hi Sid!
What value is true? I just want to hide the section all together. So, as soon as the Account record/form is opened, that section would be hidden.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2024 01:09 PM - edited 06-04-2024 01:15 PM
Hi @MStritt Simply you can use onLoad Client Script on Account record/form and use below line of code
g_form.setSectionDisplay('incident_management', false);
Regards,
Sid
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2024 01:21 PM
Got it. Thanks!