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.

Help a PHP/MySQL user understand Filemaker relationships

Featured Replies

Hi,

I've been doing web development for the last couple years and have strayed from Filemaker. I've now been recruited to work on a complex Filemaker 7 database and am having a little trouble getting my head back into the way that FM handles working between multiple tables.

What I need to do is very simple to explain and would be easy in web programming. I'm in a certain table (TableA), and based on a value in tableA I need to search for all the records with the same value in TableB and then copy multiple records from TableB to TableC. Sort of like this

$SearchID=20 (a value in tableA)

select from TableB all records where fieldA=$SearchID

$row=result

for each record {

insert into tableC values (field1 = $row[filed1], field2=$row[field2], etc)

}

Because you're only ever really on one record in FMPro, I can't figure out how to do this! Can someone point me in the direction of a tutorial for complex inter table relationships, or tell me what script steps I should be using? If I'm being to vague or abstract, let me know what soft of information to provide to make this more clear.

I understand about portals, but how do I enter records into a portal from a layout?

Thanks guys, this is a huge help.

If there's no relationship between tables a and b, then you would just script a find where you grab the value in table a in a script parameter, the script navigates to find mode in table b, inserts the value of the script parameter into the search field, and performs the search.

If you have a relationship set up where tablea::fielda=tableb::fieldb, then you could do the find with one Go To Related Records script.

To create new records with all the same values in table c, you could do an import where you import records in a found set in table b into table c. This is easier than scripting in a loop where you capture all the values from table b in global fields, and copy them to a new record on each iteration.

If you want to use a portal to enter new related records directly, you must enable creation of related records right in the relationship definition. Then there will always be a blank row at the end of the portal where new data can be entered.

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.