Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

Two Deep One-To-Many Relationship


This topic is 8003 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

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

Posted

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 ?

  • Newbies
Posted

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?

Posted

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.

  • Newbies
Posted

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

  • Newbies
Posted

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.

Posted

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.

This topic is 8003 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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