- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-24-2021 05:30 AM
here we have ritm records which needs to hide if the user is not part of "IT" team.
we tried to hide through ACL but not working as expected , field are getting hide but not the complete record.
here the ACL for reference:
if(gs.getUser().isMemberOf("IT")){
answer =true;
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-24-2021 09:51 PM
Hi,
Okay so you want this
1) if user is member of IT then show records where u_hr=true
2) if user is not member of IT then show records where u_hr=false
then update the BR as this
Condition: gs.getSession().isInteractive()
Script:
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
if(gs.getUser().isMemberOf("IT"))
current.addEncodedQuery("u_hr=true");
else
current.addEncodedQuery("u_hr=false");
})(current, previous);
Let me know if I have answered your question.
If so, please mark appropriate response as correct & helpful so that this thread can be closed and others can be benefited by this.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-24-2021 07:07 AM
Did you check if there are any other read ACL's acting on RITM table that are allowing access to read the records.
You have to make changes to these ACL's too
Please mark my response as correct and helpful if it helped solved your question.
-Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-24-2021 07:13 AM
yes , few read ACL's are there but those are conditional basis
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-24-2021 07:19 AM
Enable script debugger and see what ACL's are allowing access to read records.
https://community.servicenow.com/community?id=community_blog&sys_id=b73ea2addbd0dbc01dcaf3231f961905
Please mark my response as correct and helpful if it helped solved your question.
-Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-24-2021 07:41 AM
Hi,
what type of records needs to be hidden?
Like records where catalog item is ABC or some other condition
You can use query business rule on sc_req_item table
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-24-2021 07:43 AM
Hi,
example if logged in user is member of IT group then only RITMs belonging to 1 catalog item should be shown and rest all records needs to be hidden
BR Condition:
gs.getSession().isInteractive() && gs.getUser().isMemberOf("IT")
Script:
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
current.addQuery("cat_item.name", "Raise Hardware Request");
})(current, previous);
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader