- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-15-2017 03:40 PM
Hi Guys,
I have two tables:
Table A - is extended from Task
Table B - is a simple table with three field (user, description, parent) and one of those fields is a Parent which refers to table A.
Now I have ACLs which restrict users from viewing table A record except in the following condition:
1. User is requested_for
2. User is Assigned_to
3. User is listed in Table B
I am able to achieve this using a combination of Script Include and ACLs. However, I am getting the message "Number of rows removed from this list by Security constraints". Based on this link, I was able to create a before Business Rule:
However, I am not able to make this work for scenario number 3 listed above (User is listed in Table B).
Any ideas?
Mussie
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-16-2017 03:22 AM
If I've understood your requirements correctly then something like this should work (the BR would be on table A)
var ar=[];
var q='sys_id=';
var gr = new GlideRecord("tableB");
gr.addQuery("u_user", gs.getUserID());
gr.query();
while(gr.next()) {
ar.push(gr.u_parent+'');
}
q+=ar.join('^ORsys_id=');
current.addEncodedQuery(q);
Obviously replace tableB, u_user and u_parent with the correct table and column names!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-15-2017 11:00 PM
Can you post in you code here. so that i can check it.
Thank you,
Ashutosh

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-16-2017 03:22 AM
If I've understood your requirements correctly then something like this should work (the BR would be on table A)
var ar=[];
var q='sys_id=';
var gr = new GlideRecord("tableB");
gr.addQuery("u_user", gs.getUserID());
gr.query();
while(gr.next()) {
ar.push(gr.u_parent+'');
}
q+=ar.join('^ORsys_id=');
current.addEncodedQuery(q);
Obviously replace tableB, u_user and u_parent with the correct table and column names!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-16-2017 04:21 PM
Thanks Dan, that solved my issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2018 01:01 AM
I am trying to do something similar however the values returned in the encoded query are almost 1000+ sys_ids and due to this the URL becomes too long and the form never loads.
What's the solution for this ?
Any suggestions please.