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.

Create Record in a Related Table

Featured Replies

  • Newbies

I am desperate: I am trying to make a tape database with shotfinder. I created two tables, one tapes and one shots. I created in Tables a Field called Tape_ID (autoserial) and in Shots a Field Tape_ID. I made a single relationship (Tape Table creates Tape_ID in Shot Table).

No i want to create a Table with Tape Infos and want to create a Button with "Related Shots". When clicking on this Button, every related Shot of the choosen Tape should look up in an other Layout (List view). In the Shots Layout i want a button "New Shot" which will create a new Record related to the Tape choosen before, and i can type in the shot specific information.

It worked to view with following Layout (I choosen Table Tapes from Layout Setup) and put the whole Fields from the related Shots Database on it. But when i make a new Record, I get a new "Tape" Record, not a new "Shots" Record.

And i also not found out how i can put a Button on the Tape Layout "New Shot", which will get me to a new Layout where i can type the new Shot in, and this will automatically associate with the Tape Database.

I am an absolute Newbie so be patient with me,

Thanks alot,

Mike

Here's an example of what I think is the most efficient way to do this. It uses the new ability of a script to pass a "script parameter". This allows you to use the same "New Shot same Tape" script from two different places, and still get the correct TapeID.

Double-click the buttons, in Layout mode, look down at the bottom of the dialog, to see the script parameter.

1. You're on a Tape layout, with a Shots portal.

The script parameter is:

Tapes::TapeID (the current TapeID)

Go to Shots layout

New Record

Set Field [ TapeID;Get ( ScriptParameter ) ]

2. You're on a Shot layout

The script parameter is:

Shots::TapeID (the current TapeID)

Go to Shots layout

New Record

Set Field [ TapeID;Get ( ScriptParameter ) ]

The only difference is in the Script Parameter, in which TO is used to reference the TapeID.

So it's 1 script, with 2 slightly different parameters being sent from the button.

[Actually, the Tapes::TapeID script parameter would work in either place, because the relationship is valid to the original Tape from Shots also. But it is more politically correct to reference the local TapeID field ???-]

This method is simpler than passing the value in a global field. It is not as "visible" however (with global fields you can see what's being passed in the script itself). You have to pay attention, especially if you copy/paste the same button to another table's layout.

(P.S. I did not use "Allow creation of related records" I could have, but it has limitations, and since you're using the same script in both places...)

TapesShots.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.