Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
At this point in the process of creating our FileMaker database, we have already gone through the data modeling exercise to determine the tables, and we've determined what the relationships are going to be. And if you go under the File > Manage > Database option, it will show us here that we've got all of those tables already defined inside of our database. And by clicking on one of the tables, you see that we've gone through each one and determined which Primary and Foreign Keys we will require and defined those appropriately within the table. Now if you look at the last tab on the Manage Database window, called Relationships, you will get your first glimpse that what's called the Relationship graph, and inside the Relationship graph this is where we can establish relationships between tables and also manage those in the future.
You'll see that we have four different blocks or squares in the Relationship graph. Each one of these blocks is known as a Table Occurrence, and every time you define a table in FileMaker Pro, it automatically puts one of these blocks on the Relationship graph for you. It's important though not to think of them as a table, because as we'll learn later in the title, a single table could be represented on the relationship graph by multiple blocks, but we are not going to worry about that kind of stuff right now. For now we are going to focus on there being one table occurrence per table defined in our database.
And our goal is here is to create relationships, and this is really the easy part, too, as far as the task inside the database, because to physically create these inside a FileMaker, it doesn't really take that much effort. First, I want to give you a brief idea some of the tools that are available to us in this window. You see down here in the bottom left-hand side we've got a cluster of tables and relationships. These will allow us to create new table occurrences, as we'll get to in the future, or define relationships between them, or even write notes about the existing table occurrences if need be.
You'll also see that we can move these things around by clicking on them. You see the highlighted one is in yellow, and if we want to line them up a little bit better, we can drag-select them by holding down the Shift key and releasing. You see we've all three highlighted. And we can use our Arrange tool to do either distribute horizontally or vertically to kind of line them up a little bit better. Also, you can select them, again, holding down your mouse, dragging and then releasing, and you can choose to make them different colors by clicking on your color palette.
So, for example, we can make these all the same color, indicating that these where our initial base tables that we're using when we set up our database. You'll see we have a remaining set of tools here also. The Pointer tool allows us to select and move different table's occurrences around, and if we click on the text, I can click in here and make myself a note, and you'll see it will show up in here. It won't be a table occurrence, but just a note about table occurrences in case I want to give myself a note, or share a little note with other developers, and you can just hit Delete to get rid of it.
And then these are zooms, so if you have a lot of table occurrences you can zoom in or zoom out, or you could just type in the scale that you want to use. And since you can print your table occurrence, which is always a good idea, this allows you to determine how many pages you're going to print when you hit this button. So just like when you're in Layout mode, you'll see that the Pointer tool is the default, so therefore our cursor is an arrow. So in order to create relationships between the different tables, all we have to do is just select the Pointer icon. And so let's first create a relationship between Customers and Invoices.
What we'll do is we'll go into the parent, select the Primary Key field, and you'll see when we click down on the Primary Key field, you will see we get these little dumbbells underneath our cursor. By dragging them outside the table occurrence, now you see we have a line that now needs to be connected to the Foreign Key field in the Child table. So what's the Child table to Customers? One customer can have many invoices, right. So what we need to do is pick one of the fields in the Invoice that acts as the Foreign Key fields, and then connect the two tables together.
So that's why we use these naming convention, because we can easily see pkCustomerID is Primary Key of the Customer ID, to fkCustomerID, which is the Foreign Key. We'll just release, and now we see that that relationship has been defined, and we'll do the same thing over here, if we move the Invoice line item table. And I am going to pick the Primary Key, and I need to connect it with the Foreign Key, or fkInvoiceID. Again, the naming conventions are helping us here. And we'll choose the Primary Key in Products and link that to ProductID. And we can move these things around a little bit, and you can even collapse the table just so it shows the Primary Keys to give you a little bit more room, by hitting that little button in the upper right-hand corner.
So now that we've got the base architecture set up in our FileMaker database, you can continue on to develop the rest of your functionality. It's important to get your architecture in place first before you proceed, and when I say architecture, I mean you have to determine what kind of tables you are going to have, how they are going to be related, so therefore the key field you are going to have to use, and then you go and set up your relationships. So once you go through that process, you can then move on to start defining other things inside of your database. Later, in the Using Relationships chapter, we're going to show you various different ways that you can use the relationships that we've set up here.
A FileMaker database contain a database file with one single table in it or be composed of multiple tables inside one file that are linked internally using FileMaker relationships. These relationships are managed here inside of the Relationships tab.
Get unlimited access to all courses for just $25/month.Become a member
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.
Your file was successfully uploaded.