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.

Newbie Basic Relation Table help

Featured Replies

I can't even figure this one out through filemaker's own tutorial help function . . . . How do I create a relation? (and through which table to I make it/have it show through?

Let's say I am creating a database with two tables: Company, and People. In the Company table I have a "name of company" field as well as a "ID" field with an auto-entry serial number, and an "address" field. In the People table I have the same "name" field and also with "ID" field. If say I want to have the name of the company each person is associated with and it's address to show what other fields do I add? and to which table?

**I noticed that in creating a new table that a new separate layout will automatically be made once I specify a field for the new table (with the Define Database Box) . . . . . however if I start by creating a whole new Layout I notice that a new table won't necessarily be created for me. If I start by creating a new layout/report then I am prompted to "show records" from the other layouts and and "move" over pre-existing fields already created. How should I consider this when creating a relational database?

-brian

In the People table you would typically have 2 ID fields. The "primary" id field is the PeopleID, which is auto-enter (like the CompanyID field in the Company table). But the People file also has a CompanyID field. It is NOT auto-enter. It is a "foreign key," entered either manually (clunky) or via a relationship, ie., through a portal in Company.

On the relationship graph you would drag a line between the Company table occurrence and the People table occurrence, from the CompanyID to CompanyID. In the relationship dialog turn on "Allow creation of related records" on the PEOPLE side of the relationship.

As far as tables and layouts, the table (and at least one of its table occurrence(s) on the graph) comes first, then the layout. A table occurrence can have many layouts, but a layout belongs to only 1 table occurrence.

*The field types should be the same, either text or number, but the same.

I posted a file at your other post.

  • Author

It is a "foreign key," entered either manually (clunky) or via a relationship, ie., through a portal in Company.

. . . . . could you expand on this just a little? I'm successful in creating the relationships now by tagging the primary key ID into the foreign key entered manually. But on one on of the examples you provided me with earlier (attached) I can't locate or see where the "company id" is located on the people layout. I can only spot "company name," but no id number or field to connect the direct relationship.

-brian

CompPeople.zip

The CompanyID is automatically created by entering any other data into the portal, because of the "Allow creation of related records" (as Genx said somewhere, I think; dual posting causes these problems, flybriguy).

One doesn't normally show this to the user on a layout, because it's somewhat dangerous. But it's there, and I added it to the layout so you could see.

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