August 14, 201015 yr I hope I'm putting this in the correct forum location. I'd like to have a welcome message that says Hello (user). I have account names set up so that users can see only records they have created using the get(AccountName) command. In my employee table I have account name and first name. I'd like the welcome message to get the account name to find out who the user is and then use the first name field from the employee table. Is this possible? Thanks! Edited August 14, 201015 yr by Guest The Topic: <a href="http://fmforums.com/forum/showtopic.php?tid/216202">Custom Welcome Message</a> was moved from <a href="http://fmforums.com/forum/showforum.php?fid/267">Script Triggers</a> to <a href="http://fmforums.com/forum/showforum.php?fid/36">Ma
August 14, 201015 yr Author I may have started to figure a way to do this. I have a table called employees with fields name_first and username among others. On my welcome message I have a portal that shows only the first name from the employees table. I filtered the results to show only those records where username = Get(AccountName) The problem is that it isn't working. Am I on the right track?
August 14, 201015 yr In a script that is set to run on File>Open, start off with a Find in the Employee table: Go to Layout Employee Enter Find Mode Set Field AccountName to Get (AccountName) Perform Find If Get(foundcount)=1 Set Field gEmployeeName to Employee:NameFull Else Error, more than one or none found, do something EndIf Now you have their name in a global and can place that field anywhere without using a relationship.
August 14, 201015 yr Author Thanks for the response. I'm new to scripts. Is there a way I can copy and paste what you have there? Or do I have to go through and make a script step by step?
August 14, 201015 yr Author I having a problem with this part. Here is what I have. Get(foundcount)=1 [color:blue]Set Field gEmployeeName to employees::name_first Else Error, more than one or none found It says the specified table cannot be found (highlighting the blue area above) Do I have to have a gEmployeeName field already in a table?
August 14, 201015 yr Yes. My example assumes also that in your Employee table you have AccountName, Name_First, Name_Last and the calc field, Name_Full. Name_Full = Name_First & " " & Name_Last gEmployeeName is a global text field. I usually have a table devoted to all prefs and globals. It is a one record table. AccountName MUST be unique. So, if the script finds more than one--you've somehow entered two people with the same account name. You'll probably add a Show Dialog here, "Contact the Admin."
Create an account or sign in to comment