Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to make visible related list for User with role

miro2
Mega Sage

Hi,

Can anyone provide me solution how to make a visible Task Related List for User who has special role using ACL on read?

User with role should also see related list with Tasks

admin view

find_real_file.png

 

User with role 

find_real_file.png

 

1 ACCEPTED SOLUTION

Anurag Tripathi
Mega Patron
Mega Patron

Hi,

Based on the role you can check and show/hide related list via client script

if(g_user.hasRole('<yoru role>'))
{
g_form.showRelatedList('related_list_table_name');
}
else
{
g_form.hideRelatedList('related_list_table_name');
}

 Read More here: Hiding Related Lists and Embedded Lists

-Anurag

-Anurag

View solution in original post

14 REPLIES 14

Community Alums
Not applicable

Hi Anurag,

it should hide it - the issue is that you will see "5 records hidden" or something similar. Otherwise no visibility as far as I can remember (well, I can be very wrong for sure - just saying whats on top of my head 🙂 )

Cheers,

Joro

Community Alums
Not applicable

Actually - you are totally right! This is filter only!

So dont listen to me! 😄

Cool 🙂

-Anurag

Community Alums
Not applicable

Anyways,

as Anurag stated, one of the ways (I cant think of other one at this moment actually) is using the g_form or g_list in CSJS (client side JS, right). Otherwise you should go to ACL for this particular table (the list table)

 

Cheers,

Joro

anyway guys, @Anurag Tripathi, @Joro Klifov, thanks for quick reply