gardenlevel Posted February 24, 2008 Posted February 24, 2008 I want a simple script that will get the users name from the from FileMaker, then go to a table I created (Users) and get the the value of the id field that has the same user name (a copy of the user name is stored in the Users table). That should be easy, right? What about a good reference (book, website) just for scripting? I have "The missing manual", but I'm guessing that there's something better for scripting.
Fenton Posted February 24, 2008 Posted February 24, 2008 The simple answer is the function Get ( AccountName ). That's the name they logged in as. Whether that matches the User name in your file I wouldn't know. But the above is the best way to identify a person. There is also Get ( UserName ), but that is unreliable. In fact, this is what FileMaker Help says about it. Important: For greater security, use Get(AccountName) to track and manage user access: a user cannot change the account name used to log in to a database file.
gardenlevel Posted February 24, 2008 Author Posted February 24, 2008 Thanks for the answer, but I should have been more specific. I am aware of the GET function, but how do I match the result of the GET to the proper field in my table?
bcooney Posted February 24, 2008 Posted February 24, 2008 In a script that runs on Open, go to a layout based on a table occurrence of your Users table and Find the record that matches the Get(AccountName). Now you have the user record and his UserID. I usually set $$UserID so I have it handy all session.
Recommended Posts
This topic is 6118 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now