2 Replies Latest reply on Jun 9, 2012 6:46 PM by LaRetta_1

    Different layout depending on login

    mk4482

      Title

      Different layout depending on login

      Post

      Hello!

      I am using FMP11 on a FMP11 Server using AD logins and was wondering if there is a way to indicate when a database opens which layout to use depending on who is logging in.  For example, as the admin I want to open the "Input" layout, but I want the Library staff to open the "Library" layout.  They do not have access to the Input layout.

      Thanks!

        • 1. Re: Different layout depending on login
          Sorbsbuster

          Have a script that runs on log-in, and check for the current user name (or privilege set) and take them to the layout appropriate for their account.  It might be, in outline:

          If ( Get (CurrentAccountName ) = "admin" )

          Go to Layout (Input )

          Else If ( Get (CurrentAccountName ) = "Librarian" )

          Go to Layout (Library )

          Else If ( Get (CurrentAccountName ) = "Accountant" )

          Go to Layout (Accounts)

          Else

          Go to Layout ( Main Menu )

          End if

          • 2. Re: Different layout depending on login
            LaRetta_1

            If you want functionality at the User level then you can use a Staff table where the AD user account is stored (NEVER THE PASSWORD) within the staff table.  This table then holds the privileges which can be administered by the managers, such as OpeningLayout (in your case) and other such settings.  In this way, you can extend the functionality to individuals and not just privilege groups and it can be administered by Management.

            This does NOT replace security and privileges.  Opening script goes to the Staff table (behind a freeze window), finds the user and loads global variable with UserID (AD) and, in this case, could follow with single script step of:  Go To Layout [ by calculation ; Staff::OpeningLayout ]

            You must add to your administering tasks that if you ever change the name of one of these layouts, you change the data in that field in the Staff table.  I keep a list of things to watch for if I ever make a change to any portion of a solution or field to protect from my forgetting (or some other Developer working on the solution and not knowing).