- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2022 02:29 PM
Hello,
I'm trying to hide a tab (one I created) on our Change form so that it only shows up when a specific category is selected. I found what I think is a close example was from this Community question but I'm not sure I'm actually that close.
https://community.servicenow.com/community?id=community_question&sys_id=75397775db12f380f7fca851ca961979
This was for hiding the tab unless a specific Class what selected, and I don't know how to change the script in the example to work for my situation. I feel I'm close, I just need a little help, which would be greatly appreciated.
Thank you!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2022 02:50 PM
Hi Lee,
Try creating a UI Policy as follows;
Modify it as per your requirement.
Hopefully, this will resolve your query.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2022 02:50 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2022 09:59 AM
Thank you for the reply Muhammad, but I did this and it didn't seem to work. I'll share some screenshots of what I did to clarify what I'm looking for.
I'm just looking to get that tab to show up only when I select the Category: Security: Firewall, and it shows up still for all Categories.
I might have the name I need to put in there wrong, so any clarification would be helpful. Thank you again for replying, I look forward to your answer to this new update.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2022 12:39 PM
Section name should be like firewall_ports. Below is the reference for above assumption of your section name.
To ensure this name, open any existing record in which this tab/section is visible, then open the console in you browser and type g_form.getSectionsNames()
See the below image for reference.
When you find the actual backend name then use that name in g_form.setSectionDisplay()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2022 02:31 PM
Muhammad, thank you for the assistance. That was the correct name, and now I have this little bit of knowledge for next time something like this comes up.
For whatever reason, the Execute if True and Execute if False were backwards so I just flipped them and now my tab only appears when I'm in the correct category.
Again, thank you sir!
