2 Replies Latest reply on May 8, 2015 6:09 AM by philmodjunk

    Allocate Get(AccountName) to a staff record



      Allocate Get(AccountName) to a staff record


      I've set my DB up with account names to allow levels of access and security.  Once in the DB, there is a table for internal staff.  Internal staff are named on projects.

      What I'd really like to be able to do is for FM to detect, from the AccountName, who an internal member of staff is.  From here, I can have a home screen for each member of staff giving them a heads up on their projects.

      Is there any way to determine on login that Get(AccountName) = "Bob Smith" is the same as Staff Record "Robert Smith"?



        • 1. Re: Allocate Get(AccountName) to a staff record

          One way to do it:

          One table with the fields EmployeeID (Unique Number) and Account Name. All your employee Records, of course, must have an ID.

          So at login you could run a script looking up the ID in that table. Now you get the ID and can look up your staff records with the ID and display whatever you have to display.

          If you don't have given unique IDs to your human Resources then I don't know.... but I am sure you have....

          • 2. Re: Allocate Get(AccountName) to a staff record

            Here's an example of the script that Erna Meierdierks has recommended:

            Go to Layout ["Employees" (Employees)]
            Enter find mode [] --> clear the pause check box
            Set field [ Employees::AccountName ; Get ( AccountName ) ]
            Perform Find []
            Set Variable [$$EmployeeID ; Employees::EmployeeID ]---> Put the ID in a global variable to make it accessible throughout the file

            Here's a second option:
            Go to Layout ["Dashboard" (Main) ]
            Set Field [ Main::gAccountName ; Get ( AccountName ) ]

            With the second option, gAccountName is a global field that you can use to link to the Employees table in a relationship as well as to other tables that include an Account Name field. (A text field can be set up to auto-enter an account name when the record is first created and is often used to "mark" which records "belong" to a given user. Record Level Access can even be set up in Manage | Security to prevent users from viewing and/or editing records for which their account name does not appear in such a field.)