AnsweredAssumed Answered

Pass a Username

Question asked by PeterDowns on Dec 7, 2011
Latest reply on Dec 8, 2011 by philmodjunk


Pass a Username



In my database users log on and I use the FMP security to control levels etc. I reference the username of people with the GET command. When users log on they only see their own projects unless they are an administrator.

When someone creates a new project they take ownership by an Owner drop down box (containing their full names). Everything is cool, the only interesting new proposition that I didn't think of, is that some people enter projects on behalf of others and assign ownership to that person by the drop down box.This is fine and works however if the recipient of the projects logs on to view their projects they don't see the projects that have been entered on their behalf. 

The reason for this is

_ when a new record is created the username is added to the field "record_created_by" (this is the username of the person logged on) see pic below

_the "Owner" drop down box put a user's full name into the "Owner" field in the same projects table (this may not necessarily be the person logged on).

So the person who is logged on has his username in the "record_created_by" field for someone else's project.

Username is also different from fullname: Username is structured as - "john.smith", full name obviously - "John Smith"

What I need to do is pass the username of the person selected in the "owner" drop down box to the "record_created_by" field in the projects table when someone else is entering projects on behalf of other people.

Obviously the easy way out is to convert the Owner ddbox to usernames and pass the value but I rather keep it as full names. I thought a script trigger on the drop down box on modification for placement. I have tried a 'insert calculated result' script but no luck.

All user details are stored in a related contacts table.
Any suggestions on how to approach this.