- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2025 07:28 PM
We received a requirement that when risk user click the ALL in the list view, it should restrict them so view all the Risks created by other risk users.
Currently, this is the My Risks menu
When they clicked ALL, they see all the risks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2025 08:50 PM
the only way to handle this is creating query business rule on your table. Ensure if you have OOB query business rule on sn_risk_risk table then you add/modify code for that.
When they click they should see risks created by other user and not themselves?
Condition: gs.getSession().isInteractive()
Script:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
current.addQuery('owner', '!=', gs.getUserID());
})(current, previous);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2025 08:26 PM
Hi @Vengeful ,
1. you can create a query business rule to restrict the users from seeing the other records.
2. you can update the module and add sysparm_fixed_query this way users will not be able to click on all
but they can still be able to see all the record if query business rule or ACL is not implemented.
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2025 08:50 PM
the only way to handle this is creating query business rule on your table. Ensure if you have OOB query business rule on sn_risk_risk table then you add/modify code for that.
When they click they should see risks created by other user and not themselves?
Condition: gs.getSession().isInteractive()
Script:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
current.addQuery('owner', '!=', gs.getUserID());
})(current, previous);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader