Hide Section in the WorkSpace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-24-2024 08:39 AM
Hey Community,
I've issues with the different behavior in the workspace.
Problem Statement: In the Workspace, I want to hide the section('Impact Section') whenever we create a new record. I've written the Client Script to hide the section, but it works only in the Classic Form UI; it does not work in the Workspace. I've also tried using UI policies, but they are not working. Is there anything I should look into or any suggestions from the community to achieve this ? I've attached the client Script and the Impact Section image as well.
Thanks & Regards,
Kaka
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-24-2024 10:17 AM
Hi @Kaka_23 ,
This can be achieved via client script or a UI policy you can refer below client script.
If you want to apply this to only workspace then uncheck global check box and type appropriate view there e.g. sow, sow_new_record.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards,
Ranjit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2025 11:51 AM
You are correct, this should work, but it does not hide the section in the workspace.
This is our code
workspace sections
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-24-2024 08:43 PM
g_form.setSectionDisplay should work in workspace as well
why not simply use this? why to iterate over the sections
May be g_form.getSectionNames() is not supported in workspace, not sure
function onLoad() {
if (g_form.isNewRecord())
g_form.setSectionDisplay('impact', false);
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader