Marcelo,
This is how I set my Customer table up to work with this:
- Add a New Field:
- Field name: Team
- Field Type: Dropdown
- Click Add Field
- Select Choose from an existing Table and click Next
- Select the table: TeamMembers
- Choose a text field containing the choices: TeamName
- Click Finish
- Add a New Field:
- Field name: TeamLeader
- Field Type: Dropdown
- Click Add Field
- Select Choose from an existing Table and click Next
- Select the table: Users
- Choose a text field containing the choices: UserName
- Click Finish
This setup will auto-populate your Team Leader dropdown with the selected Team's Leader, but will allow you to change it to any user in your system and save it on a per customer basis. It would be useful if you wanted to pick a Team Leader that does not necessarily correlate with the specified Team's actual Leader. This setup will not auto-update your customers with new Team Leaders if you change a Team's Leader in the TeamMembers table.
If you would like to have the Team Leader auto-update for your Customers when you change it in the TeamMembers table, you would want to use a Linked Field for the TeamLeader field instead of a dropdown. If you do this, you will not be able to change the Team Leader on the Edit Customer screen, you will have to change the Team Leader for the whole Team in the TeamMembers table. Here's how to add the fields to your Customer table to get it to work this way:
- Add a New Field:
- Field name: Team
- Field Type: Dropdown
- Click Add Field
- Select Choose from an existing Table and click Next
- Select the table: TeamMembers
- Choose a text field containing the choices: TeamName
- Click Finish
- Add a Linked Field:
- Link Using: Team
- Linked Field: TeamLeaderUser
- Display As: TeamLeader
- Click Add Field
Then, you'll want to set up your Text Change actions for the Team dropdown like this (I've underlined any changes I made from my first reply):
- Select the Text Change event from the dropdown and select the Retrieve Value from Screen action, click Add Action:
- Select value: Team (this will be whatever your Team dropdown is named)
- Dropdown Attribute: Value (RecordID)
- Action Result name: I named mine ARTeamID
- Click Save & Close
- Select the Text Change event from the dropdown and select the Retrieve Value from Table action, click Add Action:
- From Table: TeamMembers
From Field: TeamLeaderUser
- Where Field: RecordID
value is: Action Result
ARTeamID (whatever you named your Action Result from earlier)
- Place value in: Action Result
I named mine ARTLUser
- Click Save & Close
- Select the Text Change event from the dropdown and select the Enter Value Into Field On Screen action, click Add Action:
- Update field or object: Team Leader
- With the Value: Action Result
ARTLUser (whatever you named your second Action Result)
- Click Save & Close
- I also made the Team Leader field on the screen Read Only, since it's a Linked Field and cannot be changed on the database level anyway
- Click Finish, then Publish and Save & Close the designer
Let me know if that works for you.
- Justin