Estimated Time To Read This: 2 minutes
Recently, I was working on a solution where some users only had View access to specific records in one of the tables. I set up a privilege set to do what I wanted, and – once I had worked the kinks out – things were working pretty smoothly; the test account I created could only see data in the records they were supposed to. The only hiccup was that the rest of the records showed up with “<no access>” in the fields – which is kind of ugly, and not what I wanted the user to see.
I could have set up a script that constrains the found set to what I wanted, but there is a simpler solution. When you do a search, FileMaker doesn’t include any records that the user doesn’t have access to view. So, you can do a search – any search – and it only shows records that you want the user to see. So I set up a simple, one line script that searches on a serial number field in the database using an asterisk (*). Since every record in the table has a value in that field, this basically finds all the records, excluding the records that the user shouldn’t be able to see.
So why not use Show All Records instead? Because, by default, Show All Records returns every record in the table, regardless of whether or not the user has access to view them. This returns us to the original problem – a list full of records displaying “<no access>”. By doing a search, the user only sees the records that we want them to see. You can go a bit further by creating a custom menu that overrides the Show All Records functionality with the find script mentioned above. That way, even if the user manually does a Show All Records they will still only see records that they have access to.






4 Comments
I have scripted Finds that start with a Show All Records, then the next step is to Constrain the Found Set with a specified criteria. Substituting the “*” technique will have the same effect, but I wonder which would be faster on a FMS served system?
Using Show All will return more records than searching with “*” (since Show All returns all records, while searching with “*” only returns records the user has access to), so using a Show All might be a bit slower since it would be sending more data over the network. Although you probably won’t notice much difference until you start using large record sets – for 100 records, they’ll be pretty much equal, but with, say, 100,000 records, you’ll start to see a difference.
Great tip. I plan to use this is some of my solutions.
Great tip. I plan to use this in some of my solutions.