Cant hide a particular related list in workspace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2025 10:28 PM - edited 03-17-2025 11:15 PM
I have to hide related lists to certain users. one of the related list is only visible on configure > related list, but not on form. Created a client script, it hid all the related lists on form , however it is not hiding the one that is not shown on form in Workspace.
This one is of relationship type and is added on selected realted lists but not visible on the form. However I can see the related list name (REL:xxxxxx) when printing logs in Client script. checked for any existing Client scripts , UI policies, Didn't find any.
g_form.hideRelatedLists(g_form.getRelatedListNames());
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2025 07:33 AM
If I run in executor its hiding it. as far as view its set to empty
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2025 08:13 AM
in executor it's working then it means it should work in client script as well.
Since you said view is empty then it should hide
Is it not hiding with this line? what's the concern?
g_form.hideRelatedList('REL:595d5cad3b720010d901655593efc479');
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2025 08:48 AM
It is not hiding this one particular whatever approach I take , rest of them are working fine , they contain scripted relationships and related lists too
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2025 09:05 AM
simple have only this line in your client script and see if it hides
g_form.hideRelatedList('REL:595d5cad3b720010d901655593efc479');
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2025 09:56 PM - edited 03-18-2025 10:01 PM
My code is working in default view , however in workspace view it hides all except the one I'm running into issues with. Tried testing with CS in global , workspace view . same problem exists