workspace hide/show related item tabs

servicenow14710
Tera Expert

How to hide/show based on condition a related item tab in a  workspace.

ws.png

Any suggestionis appreciated. Thanks.

2 REPLIES 2

Karthik Reddy T
Kilo Sage

You can write  client script   view should be workspace.

 

function onLoad() {
//Type appropriate comment here, and begin script below
if(g_form.getValue('state') == 1)
{
g_form.hideRelatedList('related list name');
}

 

 

Karthik Reddy T.
ServiceNow Commnunity MVP -2018 class.

Sid_Takali
Kilo Patron
Kilo Patron

Hi @servicenow14710 Create an UI Policy and select a condition on which you want to run an UI Policy. Now in Script section check Run Scripts button make it "Run scripts in UI type" All in which add a below code in Execute if True Script Editor

g_form.hideRelatedList('related list name');

 

and below code in Execute if False Script Editor

g_form.showRelatedList('related list name');

 

Please mark reply as Helpful/Correct, if applicable.

Thanks,

Siddharam