2 Replies Latest reply on Mar 11, 2010 3:44 AM by daveealex

    Record only visible if user is selected from drop down

    daveealex

      Title

      Record only visible if user is selected from drop down

      Post

      I would like to write a script that runs when the database is opened, which looks at the account name and only show records created by that user or entered by an admin.  I will explain. I have created a db that has contacts to be called. I have created a drop down with operator names. I would like to make it so that when I select the name of an operator, in the drop down, only that operator and the admin group can see the record. I would also like to do the same if a user creates a record. I am sure it is fairly simple I just can not see how to do it. Thank you in advance

       

      David

        • 1. Re: Record only visible if user is selected from drop down
          ninja

          Howdy Dave,

           

          The on board FMP help index walks you through this, actually.  Look at the topic "Editing Record Access Privileges".  There's a bunch of info at the top, then the example you are asking about down below.

           

          In your case, have the Admin use a layout where the "Account responsible" field is modifiable and have your operators use a layout where it is NOT modifiable.

          Also, set the "Account responsible" field to autoenter upon creation Get(AccountName).  For an Admin, it will autoenter "Admin" and then be changed by the admin via your dropdown.  For a user, it will autoenter the account name of the person entering it.

           

          If it is not necessary for your users to see the "Account responsible" field, simply leave it off of thier layout altogether.

           

          Note that "Show all records" will show ALL records, and have the ones that they don't have privileges for blanked out.  I tend to put a "Show All" button on the layout that actually performs a find for thier account name in the "Account responsible" field.  At the very least, put a "Find Mine" button out there...the blank appearing records get annoying very quickly.

          • 2. Re: Record only visible if user is selected from drop down
            daveealex

            Thanks for the response Ninja. I gave some of the posts a quick glance and it seems to be what I am looking for. I will give you a definite answer later. Thanks again