Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

To populate a join table automatically


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

Recommended Posts

Posted

I know it might be easy, but I'm stuck.

I need a join table to be populated automatically.

Lets say this tables

Persons: ID–Name–Code

Animals: ID–Name–Code

Materials: ID–Name–Code

ALLTogether (JOIN): ID–Data–Code

What I’d like to accomplish is:

Every time I create a new record in one of the main tables, an automatic related record should be created in the related one with some data from the main table and its code. And so if I delete the record (its related record should disappear).

I.e.:

Persons: ID: 1, Name: John, || ID: 2, Name: Mary, || Code: (global) PRS.

Animals: ID: 1, Name: Puppy, || Code: (global) ANI.

Materials: ID: 1, Name: Wood, || Code: (global) MAT.

Result:

ALLTogether:

ID: 1, Data: John, Code: PRS

ID: 2, Data: Puppy, Code: ANI

ID: 3, Data: Wood, Code: MAT

ID: 4, Data: Mary, Code: PRS

Thanks for your help.

Posted

You can use a portal to automatically create a related record through a relationship by entering it into the portal but that doesn't allow for automatically populating any of the fields other than the foriegn key field.

Other than that you would need to script your record creation in the Parent table somewhat like this.

From a button on the parent layout

Psudo script

New Record Request

Set Variable ( $id; Parent::ID )

Set Variable ( Set the info you want in the new record from the parent into variables)

Goto ( a layout based on the child table )

New Record Request

Set Field ( Child::ID ; $id ) <-- Set the foriegn key Parent ID field in the child equal to the primary key from the parent thus establishing the relationship.

Set Field ( What ever data from your variables you wanted in this new record )

Goto Original Layout

Posted

I had the idea that had to be thought a script, but hoped it could be done automatically.

I post a sample file, with the disappearing button trick implemented. I hope it can help others and if it can be simplified or improved (it's a newbie sample file so don't expect much ;-)) all help will be appreciated.

Thank you for your help.

The sample file is in spanish but I think perfectly understandable.

Test.zip

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