4 Replies Latest reply on Nov 14, 2011 11:28 AM by philmodjunk

    working within a selection based on companyname

    KoosVanRaalte

      Title

      working within a selection based on companyname

      Post

      I have a database created with customers.

      There are diferent people that work in this data base.


      I want that after a user has logged in there is a selection based on company name and that person that is logged in only can work with those companies (selection) and the other companies (not selected) do not see.

      How can I handle this in a script?

      Must i organise this with a login? or is there a other solution?

      Koos


        • 1. Re: working within a selection based on companyname
          mgores

          Tou can set controlled access on record by record basis in the security settings/access priveledges.  I haven't done much with it personally, but you should be able to find instructions and examples in the help file or search for it here.

          • 2. Re: working within a selection based on companyname
            philmodjunk

            See "Editing record access privileges" in FileMaker Help and check out this particular sub section: "Entering a formula for limiting access on a record-by-record basis" for a detailed description of how to set this up.

            • 3. Re: working within a selection based on companyname
              KoosVanRaalte

              Thank you for your answer, Phil

               

              I have read  "Editing record access privileges"  and come to a code that makes a selection based on the company afther the log in.

              What is the complete code for those records that should not be seen the really do not see. Now they get the message " no access) in each record.



              selection code" ABedrijfsnaam = GetAsText ( ABedrijfsnaam selectie )

              koos

              • 4. Re: working within a selection based on companyname
                philmodjunk

                What is the complete code for those records that should not be seen the really do not see.

                Umm, how's that again? Wink

                I think you want to fully hide the access denied records so that the user does not see them. Any find performed on the table will automatically omit records where access is denied so you can use a script as part of the process of opening the file or accessing the layout (pick one) that performs a simple find and the access denied records will disappear from the found set shown on the layout:

                Enter Find Mode []
                Set Field [YourTable::AnyNeverEmptyField ; "*" ]
                Set Error Capture [on]
                Perform Find[]

                Will do the trick as long as the specified field is never empty.

                The user can still see "access denied" records if they select Show All Records or Show Omitted Only. If you have FileMaker Advanced, you can set up a custom menu to either remove these options or you can substitute the built in functions for scripts of your own design that do the needed "show all" or "show omitted" but still omit records for which access is denied.