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.

Two Deep One-To-Many Relationship

Featured Replies

  • Newbies

How to I represent a two-deep one-to-many relationship? A good example is a database storing book information. Assume the relationship between library and book is one-to-many. Assume the relationship between book and chapter is one-to-many. How would I represent this information from the

2onetomanyrelationships.gif

Hi Jason,

Chapters from books could be displayed in Library using a global field for a relationship.

Create a g_book field

All books are displayed in a portal in the library file.

When clicking in a portal row, define a script to set g_book = book_ID (assuming each book has an ID)

Create a Portal in Library with relationship Library:g_book_ID::Chapters:book_ID(Assuming your Chapter file has a Book_ID next to the Chapter_ID).

You can now see the chapters from a book within the Library file. Is it what you need ?

  • Author
  • Newbies

Thanks. That's exactly what I needed!

What are your thoughts on using FileMaker for a relational database? I'm I going to run into things that I can't do with FileMaker?

Well, I really can tell that I am everyday some more surprised by FM capabilities and relational design...

I think the only limit would be for a huge multi user system, but as this is not my problem, I agree with most of those folks here : There is nothing FM cannot do...even using some workarounds.

Tell if you had difficulties in setting this up.

  • Author
  • Newbies

I had no problems viewing a record that was 2 one-to-many relationships away using the global variable. I also set it up so that I could edit the record 2 relationships away.

I added another neat feature. My portal is so large that it takes up a big part of the screen. So I set up the script so that when you click a button to see the detail it also takes you to the other part of the screen where the detail is shown. It acts similar to a bookmark in HTML. This is how I did it:

-Create a text field that auto-enters data containing the title of your detail section. Make the field uneditable and don

  • Author
  • Newbies

Dilucaugo, I was looking at your original directions. How would you change the global variable whenever a portal record was entered? What script functions would do that? I'm currently using a button to do the same thing.

Thanks.

If I understand, you would like to edit and create new Chapters while being in the Library file, using the global.

Here is attached a test file with the kind of relationship I will use to set entries in a two relations away using a single file.

Is there any way to automatically update the value of the

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.