4 Replies Latest reply on May 20, 2014 2:51 PM by jackmac

    Go to user record on login

    jackmac

      Title

      Go to user record on login

      Post

           Hi all,

           I've tried a few different approaches to this but would like some input if possible.

           I have three departments:

           Sales

           Admin

           Office

           Each has their own login (they keep staff records and details in the system). Whilst I use the same layout for creating the department and for their own staff record, I want Sales to use their own login and see only the staff layout showing their record and also when they look at the 'staff' layout they see only the records where say Department=Sales.

           Any ideas? I don't think I need to create individual tables for each department. The HR department need to see al staff so they'll have an admin login which lets them see all departments.

           Thanks

        • 1. Re: Go to user record on login
          philmodjunk

               You can use Manage | Security to control what layouts can be accessed by a given account.

               And you can also limit their access to only specific records in a given table.

               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 description of how to set this up.

          • 2. Re: Go to user record on login
            jackmac

                 Thanks Phil. I've already set the security up so that each department can only see the data record for say Department (I want them to see their own department info) and Staff (they will see a list layout with all staff and a record layout with the staff member details).

                 I've set some of the other layouts as admin only so the standard user (people in departments). What I'm try to get is that when Bill in Sales uses his login details, he'll go straight to the Department layout and the 'Sales' details will be there. When he clicks to go 'Staff' layout, he'll only see those working in the 'Sales' department. With the looking at staff I'm working on using something like Get (Username) then I could get the filter to show only records with Department=Sales. In this case, the username is Sales.

                 The tricky part I'm finding is getting the correct record based on username.

                 Using FM12 Pro Adv and Mac & Windows

            • 3. Re: Go to user record on login
              philmodjunk

                   The "correct record based on username" probably should be "correct record based on Account name" User names and account names are not the same thing though FIleMaker can make it look like they are the same when it takes the user name set in preferences and automatically enters it as the default account name when the password log in dialog pops up.

                   In either case, this should be part of the "lock expression" controlling a given user's access to specific records in each table where you need that level of control. That's why I referred you to the help article that describes how to do this.

                   Once that is set up, any find performed by the user or a script--such as one performed by the OnFirstWindowOpen or OnLayoutEnter triggers, will automatically produce a found set where all records for which the user does not have at least "view" access permission will be omitted from the found set.

                   This simple script example will find all records for a "full access" user, but for users like your sales staff, it will find all records for which your user has permission to view:

                   Enter Find Mode[]
                   Set Field [LayoutTable::NeverEmptyField ; "*" ]
                   Set Error Capture [on]
                   Perform Find[]

                   The only way around this limitation of found sets is if the user uses Show All Records or Show Omitted Only. In those cases, any record brought up for which the user does not have "view" access will be covered by a "no access" screen.

              • 4. Re: Go to user record on login
                jackmac

                     Thanks Phil,

                     I'll give the lock expression a try and see how best to mould it to my solution. The solution will be run exclusively in FM Go and I've found the restrictions in-built with Go make it an ideal tool for my needs.

                     As ever..Thanks!