Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 5362 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I want to have users log into database with user id, and they are then presented with their own record which they can edit. My way of doing this is rather convoluted, and I always thought it would be something straightforward using get(accountname). However, get(accountname) returns the account who created the record (which is always done by Admin), and not the user logged on. Is this correct? I attempted a script that checked whether user id matched get(accountname), but always got no match.

So. is there a variation of the get command (or something else) that allows me to find the user logged on and not the user who created the account?

Thanks for any help (using FMP10A).

Posted

If you want to have a user log in and navigate to a specific record, then that record must have a value in it that identifies it as "their" record.

Get (AccountName) matched to AccountCreated field works, as you've discovered, if the current logged in user is the one to create the record. In your case, all records are created by account Admin.

So, you need a field in the table, such as AssignedTo, that matches your user. AssignedTo would contain the UserID.

I typically have a Users table. The table has __kP_UserID (primary key) and Name_Last, Name_First, AccountName, PrivSet, email, etc.

In a startup script, I use a routine that finds in Users for Get (AccountName). Now, I'm on the User's record. I have their UserID. I can now go to related record anywhere by using a relationship from Users to AnyTable by UserID.

hth,

Barbara

Posted

Thanks Barbara, I have it all functioning perfectly now. I did have a solution before which used much of what you suggest, but I had many layers of extra (unnecessary) complex also included.

No more!

Thanks again.

This topic is 5362 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.