Client Script Action to click on Section tab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-11-2012 05:47 AM
We have a group of fields on a form that are required and in a Section tab, if you click on a "Close" button then it will start the Client Script to check if they have been filled in. If you have the tab open and you add some mandatory fields then it will go right to that field. However, if you are not selected on that tab, it takes you to the tabs but you have to select on the tab that is Red.
I would like to go one further and have that tab automatically open upon click of the "Close" button. Is there a trick with SN to do this or do I have to employ CSS?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-11-2012 12:35 PM
It's onSubmit, weird... I put it on a 50ms delay on the call and it works:
setTimeout(function (){ switchSectionTab("Closure Information"); }, 50);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2013 06:04 AM
Mark,
I have to come back to the well (this topic) for some more, though I want to focus on Related Lists. What I want to do is if they are in a certain view, I want to hide some Related List tabs they don't need to see.
With the code on setting active, is there an easy way to do this with some CSS or is there something a bit more tricky in ServiceNow to hide certain tabs?
Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2013 07:06 AM
Hiding related lists can be done in client scripts. Here's another SNGuru article.
http://www.servicenowguru.com/scripting/client-scripts-scripting/hiding-related-lists-embedded-lists/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-10-2015 05:55 AM
Is it possible to set a section as the active section in the same way as this now that sections can be called by name?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-24-2017 11:48 PM
Hello Mark,
Can we rename Section Tabs name g_tabs2Sections if yes then can u provide me some code for that .
I am building an application so there is a restriction that it should work on Application Scope. i was trying using DOM but it doesn't worked.
Regards Kumar
Application Developer
!nMorphis Services Pvt Ltd