Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

To populate a join table automatically

Featured Replies

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.

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

  • Author

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

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.