2 Replies Latest reply on Apr 2, 2015 10:50 AM by philmodjunk

    Get(accountname) does not work



      Get(accountname) does not work


      FileMaker Pro



      Operating system version

      Windows 8.1

      Description of the issue

      I want to control access to different parts of my database by requiring the user to enter their account name and password.
      Irrespective of the account name used to login it returns "admin".

      Steps to reproduce the problem

      I have used included the account names in a table of users and created a field containing the formula Get(accountname) in each related table.
      My account names are Admin, User, [Guest] where Admin corresponds to access level "admin" with full access to develop the database, User can add, edit and delete records, and [Guest] is read-only. While the database opens with the required access level Get(accountname) always returns the name "admin".

      Expected result

      Log into Filemaker as User (with the password) or [Guest] (with no password). I expect Get(Accountname) to return the account name entered at log in: User, or [Guest].

      Actual result

      Log into Filemaker as User (with the password) or [Guest] (with no password). Get(Accountname) returns: admin


        • 1. Re: Get(accountname) does not work

          Bob .:

          Thank you for your post.

          The calculation for "getusername" is correct, but you will need to make this unstored.  That is, in Manage Database, select "getusername", and in the bottom right area, click "Options...".  The "Specify Calculation" window appears with the calculation.  In the bottom right area, click "Storage Options...", and under Indexing, enter a check mark next to "Do no store calculation results -- recalculate when needed".

          Let me know if you need additional clarification.

          FileMaker, Inc.

          • 2. Re: Get(accountname) does not work

            A picky, but important quibble. GetUserName returns the USER name not the account name. The Account Name calculation field is the one that needs to be set to unstored to show the account name.

            Account names and user names are often the same for a given user, but they are not really the same. User names are specified in preferences and account names are defined in Manage | Security.

            The account name can also be displayed on a layout using layout text via a menu option you can select from the Insert Menu while in Layout mode.