Jump to content

Populating field based on Account Name


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

Recommended Posts

I am trying to create a script that will autofill a person's email address based on their user account name. I know I could do an if-then step in the script, but for 40 users that would be a lot. Is there a way to use the Set Field with a calculated result? What I imagined was this:

Get Accountname

If Accountname=bookkeeper set the field to [email protected]

If Accountname=purchasing set the field to [email protected].

Is it possible to do that in one calculated result?

Link to comment
Share on other sites

You should have a User (or Employee) table, where the Email address is stored, along with the Account Name. You can then use this on the child side of a relationship from a "CurrentUser" global or unstored calc in the local table to the Account Name in the User table. With the relationship established, you can reference the Email address (or whatever fields you wish) from the User table. The script can then grab the related Email field and insert it in the local record using Set Field[].

Link to comment
Share on other sites

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