- I have a layout that is based on my Monthly Hours Table. This table is related to my Members Table.
- In that layout I have a portal based on the Responders Table.
- The Responders Table is related to my Member Table, which has all of the information on each person on the team.
- To relate everything together I have a Members Foreign Key in both the Responders Table and Monthly Hours Table.
- For the Monthly Hours Table I have the Members Unit Number & Name. I have these auto enter when a member creates a new record, using a new record button. The script takes the login name and parses it to look up the primary key in the Member Table. I then copy that value and paste it into my Member_Foreign Key field. That causes an auto lookup of the members Unit # and Name from the relationship Member::PrimaryKey to MonthlyHours::Member_ForeignKey.
- I want to do the same sort of thing when I click into the Member_ForeignKey in the responder portal. Or if possible when I click into the date field, thus not having anyone click into the Member_ForeignKey field.
- The Member_ForeignKey in the Responder Portal is stacked on top of the Unit # Field.
- I do store the Member_ForeignKey into a global value, $$Member_FK, when a person logs into the solution.
This is my new record script that fills the information in the Monthly Hours portion of the layout:
I tried this, but am stumped. As well as I'm having trouble navigating portals.
If the relationship to Responders is set to Allow Creation of Related Records then the foreign key will automatically be added when a new record is created.
If you have this option checked any portal will have a spare row showing at the bottom, and you can use this feature in a record creation script (go to the portal, then navigate to the last line, then enter your data—record will be created and FileMaker will enter the FK for you).