PTKen Posted March 9, 2007 Posted March 9, 2007 Hello. I have a database with a Users table. In the Users table there are fields: ID, name, acct (simplified for purpose of example). The field "acct" contains the same name as the account that the user will log in as. Throughout my database, the users are related to records in other tables through the ID field. There are times when a user will create a new record and the user's ID needs to be recorded in that record. I would like to automatically insert the correct user ID into a field of a newly created record based on the account that they are logged in by. It seems like it should be simple, but I cannot seem to find a good way to do it. I know about the get(AccountName) script step, but how do I use it to find the user ID that is associated with that account? I don't think a relation or lookup seem correct, but I'm probably wrong. None of the script steps seem correct to me either. How would I go about this? Thanks in advance! Ken
mr_vodka Posted March 9, 2007 Posted March 9, 2007 Just create a text field with auto-entry option of Creation Account Name
PTKen Posted March 9, 2007 Author Posted March 9, 2007 Just create a text field with auto-entry option of Creation Account Name I know how to do that, but what I'd like to do isn't to enter the account name (text field) into every record that the user creates, but rather to enter the user's record ID (number field). Since the User table contains a unique field that matches the account name, I can associate the account name to a unique record (and therefore the record ID), but I just can't figure out how to make the connection in order to pull the correct ID. Would it involve doing a search for that account name and then taking the ID of the found record? How would I go about that? Thanks. Ken
mr_vodka Posted March 9, 2007 Posted March 9, 2007 Store the user ID in a global field as part of the opening script step. Then for the records that you want to auto populate the UserID, reference that global field in the calculated result or lookup option. As for actually finding the correct record, to pull the ID from, you could use a find to do this.
Recommended Posts
This topic is 6470 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