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

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

Recommended Posts

Posted (edited)

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 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
Posted

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?

Posted

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.

Posted

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?

Posted

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?

Posted

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."

This topic is 5215 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.