7 Replies Latest reply on Jul 28, 2017 2:45 PM by gmainis

    Hide records that users don't have access to?



      Hide records that users don't have access to?


      Hi everyone quick question.  I have a basic CRM in FileMaker, with Accounts, Contacts etc.  The Accounts table I have under Manage | Security, a custom security set restricting users to only access their own records.  So under access I have limited, and the calculation Get(AccountName).  This works, as users can only access their own records.  The problem I have though is they can still see all the other records which is a big mess.  So for example, when users log in it goes right to record #1 under Account layout by default.  However as I was the one that made that, whenever a user logs in, it just shows my record with << No Access >> on every field.  If they go to a list view and select a view like "All Accounts" it will show like:

      ABC Company
      << No Access >>
      << No Access >>
      XYC Company
      << No Access >>

      Etc.  How do I set it so that they just full on never see a record they don't own?  For the list view it's easy enough as I've set custom views with filtering to only show their records, but it's more the account view.  I don't like how there could be 1000 accounts in the system with only 1 that they made, but it still lets them cycle through all those records and know how many there are, even though they all say << No Access >>.  Just hoping there's a way to fully hide them and if not is there at least a way so that when they log in, it will go to either the last record they were working on, or to the first one they can access, vs one that shows all no access?  Thanks!

        • 1. Re: Hide records that users don't have access to?

          Simply perform a find. This can be in a script. Any found set produced by performing a find will automatically omit << No Access >> records. This leaves "show all records" and "Show omitted only" as the only  means by which a user can pull up a set of records that includes  no access records. If you have FileMaker Advanced, you can install a custom menu set that prevents even those two options from pulling up "no access" records.

          • 2. Re: Hide records that users don't have access to?

            This works, except if users want the ability to do finds on their OWN records.  If so, then presumably they will need access to show all/omitted to get back to a view of ALL of just their own records.  So you would need to prevent access to the native show all/omitted and write your own scripts for those which are really just a version of the original Find again.

            • 3. Re: Hide records that users don't have access to?

              Rather than re-creating the privilege requirements in the scripts, you could just have the "show all" script do a find on a field that should always have a value in it, like maybe searching the primary key field for *.


              For show omitted, you could also follow the intended step with a constrain find that, again, just searches for a known value.


              The benefit is that you don't end up writing your privileges twice. In both cases, you're really just adding one generic step.



              Chris Cain


              • 4. Re: Hide records that users don't have access to?

                Yes, I think we're on the same page.  Didn't mean to imply a need to re-create privilege requirements in scripts.  Just pointing out that the Show All / Modified scripts must be modified as you suggest, since you would need to remove the native Show All/Omitted.


                And Lock the toolBar closed as well.

                • 5. Re: Hide records that users don't have access to?

                  Was more worried that the OP might not have caught that. It's one of those scenarios where you can work pretty hard before you realize you don't have to.


                  Man, if I could get back all the time I wasted years ago checking for if month >= 12...


                  Chris Cain


                  • 6. Re: Hide records that users don't have access to?

                    Hey here's a FM  behavior that is almost certainly something I'm doing wrong but don't know what:


                    The FIND * method above works great with my privilege set rules when working on the local client, but when the file is served, ALL FINDS return NO RESULTS.  And so neither does FIND *.


                    [Full Access] works fine when the file is served, and when I log in with my other privilege set, native SHOW ALL RECORDS returns my viewable records as well as all the <no access> records.  But performing ANY FIND, with ANY criteria (not just *) returns error 401.


                    Why would my privilege set work as expected locally, but not allow FINDS when served?


                    I am serving the file from FMPHost.com to test it.  FM Pro 14.  Mac OS 10.11.3


                    Actually, I think I found my answer here:  Limiting Access On A Record-By-Record Basis


                    I was using a $$VARIABLE.  Switching to a GLOBAL FIELD instead and see if that solves it...  (shoulda done that anyway for security reasons)



                    YUP!  That was the problem!  THANKS FM COMMUNITY!


                    So much to LEARN!

                    • 7. Re: Hide records that users don't have access to?

                      Yes you can get either a <No Access> or a ?.  I find the easiest way to make that go away is with a Conditional Format; Value = <No Access> and font size 99.  What happens is FileMaker recognizes the No Access and resizes the field value too big to display, hence hides the field.


                      Greg Mainis

                      Simplified Software