How to Hide related links and related lists using client script or UI policy on portal for standard changes

SumanthMora
Mega Guru

How to Hide related links and related lists using client script or UI policy on portal for standard changes (without updating the condition on the respective UI actions)

1 ACCEPTED SOLUTION

Here you go:

https://community.servicenow.com/community?id=community_question&sys_id=fe344e92dbbc5b404fc2f4621f96...


Please mark my response as correct and helpful if it helped solved your question.
-Thanks

View solution in original post

9 REPLIES 9

Swadesh Saraf2
Kilo Guru

If you have to hide it always on the portal, i would suggest to create a new view and use view rule function to achieve the same.

 

Alternatively, if you have to do it on some conditions, check the below URL and on the client script, define it to run it only on Portal

https://www.servicenowguru.com/scripting/client-scripts-scripting/hiding-related-lists-embedded-list...

 

 

I Could able to achieve Related Lists but not Related Links.

Related links are nothing but the UI actions, so there is a function in the UI action to show them based on the views. If you have a separate view of the portal, it will be easy to manage.

 

I have found this article as well, it shows a way to achieve what you are expecting but it needs a custom widget:

https://community.servicenow.com/community?id=community_question&sys_id=fe344e92dbbc5b404fc2f4621f96...

 

My personal preference for this problem will be to have another view instead of a new widget altogether.

Prasant Kumar 1
Kilo Sage

Hi,

Use the below code code in client script:-

g_form.hideRelatedList('related list name');

 

If i was able to solve your query, please mark my answer correct and helpful.

Thanks & regards

Prasant kumar sahu