4 Replies Latest reply on Jul 27, 2010 1:21 PM by philmodjunk

    opening Script help

    CraigFiore

      Title

      opening Script help

      Post

      Hello,

      Can someone help me wright a script to go to a certain layout when a specific users logs in.

      For example:

      Currently when FM is opened it goes directly to the "Main Menu"

      What is want to do is when "Steve" logs in, I want to go directly to layout "Invoices"

      Is this possible?

      Thanks

        • 1. Re: opening Script help
          philmodjunk

          Is "steve" an account name or a privilege set name? There are get functions to check either so the script is basically the same though I recommend privilege set names if at all possible as this is more flexible as "Steve" might not always be the person you want to send directly to the Invoices layout in the future, but their privilege set name is likely to be the same.

          If [Get ( accountPrivilegeSetName ) = "Sales" ]
             Go To Layout [Invoices]
          Else
             Go To Layout ["Main Menu"]
          End If

          Simply use File Options in the file menu to select the above script to run when the file is opened.

          • 2. Re: opening Script help
            CraigFiore

            Steve is the UserName.

            Your idea sound better. But i can not find Get "( accountPrivilegeSetName )" under the get menu. Is is available in FMP 10.0v3?

            • 3. Re: opening Script help
              ninja

              howdy,

              Get (PrivilegeSetName) is what you're looking for...

              • 4. Re: opening Script help
                philmodjunk

                It's a filemaker 11 function. In filemaker 10, you'd use Get ( privilegeSetName ).

                The difference between the two functions is that Get ( PrivilegeSetName ) returns "[Full access]" if the "run with full access permission" has been selected for the script where Get ( accountPrivilegesetName ) will still return the expected privilege set name. As long as your "on open" script doesn't have that option selected, either function can be used.