- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2024 01:55 PM
Our team has a requirement to hide the first form section aka the form section that shows onload. When we use
var sections = g_form.getSectionNames();
alert(sections.toString());
that returns all the form sections that appear in tabs on the form, but does NOT include the section that shows on the screen (ticket_details):
We noticed that there is another method --
var sections = g_form.getSections();
alert(sections);
But when we load the page, the alert shows as an array of HTML Objects:
Notably there are 5 objects in the array instead of 4 from above, so we're hopeful that this could be our answer, but how can we get the names of each Section instead of showing the [object HTML SpanElement]?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2024 10:40 PM
Hi @davilu ,
Typically, in every table form, the first section is named after the table. You can verify this by checking the form layout.
Refer to the image below for the incident:
However, I don't believe the first section can be hidden through a script, as it is generated by ServiceNow by default when the table is created.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you found my response **helpful**, I’d appreciate it if you could take a moment to select **"Accept as Solution"** and **"Helpful"** Your support not only benefits me but also enriches the community.
Thank you!
Moin Kazi
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2024 06:09 PM
I believe you cannot hide that section using SN methods because it is created default by table creation.
The first section name will be the name which is displaying above the form number.
Murthy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2024 10:40 PM
Hi @davilu ,
Typically, in every table form, the first section is named after the table. You can verify this by checking the form layout.
Refer to the image below for the incident:
However, I don't believe the first section can be hidden through a script, as it is generated by ServiceNow by default when the table is created.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you found my response **helpful**, I’d appreciate it if you could take a moment to select **"Accept as Solution"** and **"Helpful"** Your support not only benefits me but also enriches the community.
Thank you!
Moin Kazi
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2024 10:35 AM
Thank you, I think you're right!