module argument to list cases by user company and/or location

lwatts
Kilo Contributor

Hi,

 

I am trying to create a module for specific user that list all hr cases and hr tasks for  their location.  I have created a group and a role for these users and and assigned hr case reader and hr task reader roles.  The individuals in this group are at different locations/companies and I want them to only be able to view for their location.  I have tried a couple of arguments I found online but they have not been successful.

 

Does anyone have any suggestions to get this to work?  

Link type:  List of records

Table:  Task

Filter:  Active is true or false

   Task type is HR Case or HR Task

Arguments:  company = javascript:gs.getUser().getRecord().getValue('company')

 

Thanks,

 

Lorenzo

1 ACCEPTED SOLUTION

tolga1
ServiceNow Employee
ServiceNow Employee

hi lorenzo


i would propose to do this with ACLs. The thing with configuring a list view is, that the records would still be all available for all users (via search or via modifying the filter). If you configure an ACL for this, the records are strictly restricted to the relevant role.



Read here how to set up such ACL rules: Create an ACL rule



Be careful, modifying ACLs require some experience.



Best Regards


View solution in original post

5 REPLIES 5

shivanipatel
ServiceNow Employee
ServiceNow Employee

Lorenzo,



We are glad you took advantage of the ServiceNow Community to learn more and to get your questions answered. The Customer Experience Team is working hard to ensure that the Community experience is most optimal for our customers.



If you feel that your question was answered, we would greatly appreciate if you could mark the appropriate thread as "Correct Answer". This allows other customers to learn from your thread and improves the ServiceNow Community experience.



If you are viewing this from the Community inbox you will not see the correct answer button.   If so, please review How to Mark Answers Correct From Inbox View.



Thanks,


Shivani Patel


Unknown-1.png