- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-25-2016 07:11 AM
I have applied an ACL condition to a list for a table but that limits the results properly but when viewing the list you still see the total results for all items in the table and the pagination is still applied as if all results are returned. Is there a way to make sure the pagination and total results returned are in sync with the ACL condition?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-25-2016 07:45 AM
I have not found a way to remove that message. You can use a Before Business Rule instead. So for whatever table you are limiting the number of records on, for example the Change table, you can create a before business rule on that table and limit it by Role for example. Below is an example script, limiting the list of resulting records to opened_by the logged in user, where they have the change_user role. You will have to play around with it a bit, and make sure to test against other users.
limitViewByRole();
function limitViewByRole() {
if (gs.hasRole('change_user') && gs.getSession().isInteractive()) {
var u = gs.getUserID();
var vc = current.addQuery("opened_by", u);
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-25-2016 07:18 AM
Hi Robert,
Can you send a screenshot? I suspect something else is at play here. There may be ACLs preventing you from reading records. In which case you get a message about security constraints preventing you from seeing records.
To remove those and get the information to display ONLY the records you have read access to, take a look at Before Query business rules. See section 10 here
Scripting in Business Rules - ServiceNow Wiki

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-25-2016 07:33 AM
For some reason, the number of records will not be in sync with total records that your ACL have access to. As chuck mentioned, use before query BR.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-25-2016 07:45 AM
I have not found a way to remove that message. You can use a Before Business Rule instead. So for whatever table you are limiting the number of records on, for example the Change table, you can create a before business rule on that table and limit it by Role for example. Below is an example script, limiting the list of resulting records to opened_by the logged in user, where they have the change_user role. You will have to play around with it a bit, and make sure to test against other users.
limitViewByRole();
function limitViewByRole() {
if (gs.hasRole('change_user') && gs.getSession().isInteractive()) {
var u = gs.getUserID();
var vc = current.addQuery("opened_by", u);
}
}