aguest Posted January 15, 2015 Posted January 15, 2015 Hi,  I hope someone can help me. I've create a script (posted below) which uses the Get(AccountName) function to look up the users account name in a table and return the department they sit in (as a FK). I then use this to perform a find on my layout and return only the records that the person has access to view.  This works, however, instead of just returning the 5 or so records I want (as it does if I were to perform a find on the actual layout manually) it returns all the records but has <No Access> populated for all the other records.  Can anyone tell me if I've missed out a step in the script or something else so I can figure out why it's not working.  Many Thanks in advance.  Â
Wim Decorte Posted January 15, 2015 Posted January 15, 2015 have you stepped through your script with Script Debugger to see if the IF actually works? Also, in your search for $dept, use "==" & $dept otherwise you may get more results than you expect (if you look for dept 1, you would also get dept 11, 110,...) unless you do the "exact" search with "=="
Fitch Posted January 15, 2015 Posted January 15, 2015 The Show All records command does not respect the record-level security in terms of the found set. Instead of Show All, do a Find where the ID is >0 (or *). This will use the security settings to return only records accessible to the user.
hbrendel Posted January 16, 2015 Posted January 16, 2015 Does your script run with full access privileges? (bottom of the Edit Scripot window)
aguest Posted January 16, 2015 Author Posted January 16, 2015 Thank you all for your help. I've got it to work so it only show the records they have access to.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now