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

Pick up relaited field data

Featured Replies

I have a dispatch solution where a selected driver picks up a member passanger and takes them to a destination. Members and Drivers have dedicated tables. A trip table reflects driver name and passanger name, pick up location, pick-up time, travel distance and charge. New trip record allows for passanger and driver fields input from drop down lists.

What I am trying to accomplish is that once a name is selected a script will run that goes to the member file picks up the member ID and then paste it into the fk_membersID field. I have tried to get the data into the field via a portal but can't get it to work so I thought that using a script would be OK.

Try using the function "Get (ScriptParameter)"

In the "Member File", create a scripted button where you define the optional script parameter, click on edit, then select your primary key, thus, MemberFile::MemberID will appear as the parameter. In your related file, say,

Set Field [fk_membersID = Get (ScripParameter)]

Your script would look something like this and should be called from your MemberFile:

Go to Layout[Trips]

New Record

Set Field [fk_membersID = Get (ScripParameter)]

Just as a side note -

If you're using (or will be) FileMaker Pro 8 Advanced, you can use script variables for this job as well. I do it all the time and works great. What Breezer has suggested works great with either 7 or 8.

I have tried to get the data into the field via a portal but can't get it to work

Have you checked that your relationship allows creation of records? The portal approach is simpler to implement and maintain. Or you create a Trip layout that includes dropdowns for Driver and Member that use value lists for the respective data files...

David

  • Author

I don't yet understand scripting steps that well. I created the button as you suggested but when I attempt to create the script in the scripts menu I get nowhere. I would appreciate a bit more guidance.

Thank you very much for your help

Mitch

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.