- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2020 06:26 AM
Hi All,
Hope everyone is staying safe.
I got requirements like,
1. For a custom table say XYZ, users named A,B,C create some records. Now when A log in to his instance ( or when i impersonate to user A) he needs to see records that are opened only by him and even breadcrumb shouldn't be visible to him, because if breadcrumb is visible he can edit that and can able to see all the records. So in order to restrict him from seeing all the records, what can we do to restrict him to see only records opened by him.
2. And the second thing is the report level access, while creating reports also he should not able to see all the records, he needs to have only records created by him.
Your valuable answers help me a lot.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2020 06:36 AM
Hi Rakesh,
For the filter/breadcrumb you can use fixed query. Refer link for a check. In addition to this you need a Query Business rule that runs on the Custom table that again restricts the visibility.
Since, Query business rule will run on Table it will take care of reporting as well.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2020 06:36 AM
Hi Rakesh,
For the filter/breadcrumb you can use fixed query. Refer link for a check. In addition to this you need a Query Business rule that runs on the Custom table that again restricts the visibility.
Since, Query business rule will run on Table it will take care of reporting as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2020 09:07 AM
Hi Jaspal,
Thanks a lot for the answer.
Regards,
Rakesh Gudisa
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2020 07:48 AM
Hi Rakesh,
please refer below response
1) For restricting to show only those records opened by logged in user; you can use query BR on that table
Even if they change some filter they cannot view other's record. Query BR will take care of restricting
Sample Script
function onBefore(current, previous) {
//This function will be automatically called when this rule is processed.
current.addQuery('opened_by', gs.getUserID());
}
2) for report level; the above Query BR will take care restricting at report level also
If my answer solved your issue, please mark my answer as ✅ Correct & 👍Helpful based on the Impact.
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
07-02-2020 09:06 AM
Hi Ankur,
Thanks alot for the response. Can you brief that, how can we use BR at report level.
Regards,
Rakesh Gudisa