3 Replies Latest reply on May 10, 2010 8:02 AM by MegaMe

    Newbie - Each user can only see and view their own entries



      Newbie - Each user can only see and view their own entries


      I am new to fmp.


      I created a fmp database to keep track of sales.


      We have several sales people and I want them to access this fmp file over web sharing and enter their own sales.


      As the admin, I want to be able to see everybody's sales.


      So I create a user in the fmp file for each sales person and they each have their own unique password.


      Is it simple to have my fmp file assign each record created by the log in user to be assigned logged in user. 


      For I could create a filed called "Agent" and when ever a new record is created, the Agent field is auto filled with the user name of the person who logged in.


      But I want to have the admin have the ability to assign the "Agent" field with whichever sales person user name I want.


      I see Get(AccountName) and Get(UserName) in fmp help.


      Plus, whenever a sales person logs in, I want them to only to be able see and edit records assigned to them.


      Are these two things simple?


      Thank you,



        • 1. Re: Newbie - Each user can only see and view their own entries

          As far as simple  things are concerned yes and no.


          Your sales people will need to have the layout that they view and edit data in keyed to a global field that contains their user name

          then the layout shows related records compared to this global field


          Depending on the number of child recrods etc you may need to make the key more specific and put a calculation field into the sales(other) record that combines more than one key such as customer ID and username.


          This way the first key shows you all sales

          the second key shows you all this specific customers sales.


          So to explain my answer yes it can be done but its takes a bit of skill in defining keys and relationships. based on what exactly you want it to do.


          For the admin level you  need a separate layout which does not use the global key but looks at the records directly.


          Clear as mud?


          It really depends on what you consider easy.  :)

          • 2. Re: Newbie - Each user can only see and view their own entries

            You can set a field to auto enter account names. Since this is a data field, you can set it up that authorized users can then change this field by assigning a different account name to it. You can even put a list of account names in such a field if you want a group of users to have access.


            Once you've set up that field, you can use Manage Accounts & Privileges (FMP 10 and earlier) or Manage Security (FMP 11) to set access privileges for records in each table of your database.


            A simple expression that may serve here is:


            Get ( AccountName ) = Table::AccountName


            Where Table::AccountName auto enter's the user's account name when the record is created.


            Once you have that set up, you can hide the denied access records with scripts that only find records that contain the user's account name in this field. In filemaker advanced, you can even modify the various menu options to omit these records when a find is performed or the Show all/Show Omitted options are selected.

            • 3. Re: Newbie - Each user can only see and view their own entries

              Thank you for the replies.


              I have to realize my limits. I am enjoying FMP very much, but have decided to search for a freelancer to handle the things I don't know how to do.