Relationship Setup - File Maker

Now that you understand the basics of the relational database model, let’s look at how you set up a relationship in FileMaker Pro. To begin, open the Computer Shop folder on the CD-ROM, then double-click the Company.fp5 database. Navigate to the Contacts tab and switch into Layout mode.

Note that there’s a portal into a related database here already, Contact.fp5. In order to see the definition for this relationship select Define Relationships from the Database menu; the Define Relationships dialog appears.

You’ll see in this dialog that the relationship to Contact.fp5 is already defined, but take a moment to explore this dialog box before you go any further. Note that you can sort relationships by clicking the columns or by changing what’s in the View By drop-down menu. You can create new relationships with the New button, edit the highlighted relationship with the Edit button (or just double-click the relationship), duplicate the highlighted relationship with the Duplicate button and delete the highlighted relationship with the Delete button (remember, this is permanent). The Done button closes the dialog. The information shown for each relationship is the name you specify, the fields involved in the relationship and the database being related to from the current database.

Go ahead and double-click the relationship called Contact by CompanyID.
The following Edit Relationship dialog will come up:

Edit relationship

The name of the relationship is in the box at the top. The Specify File button allows you to navigate to the database you want to relate to. In this case, Contact.fp5 is already selected, and its fields appear in the lower right window. Company.fp5’s fields are in the lower left window.

To pick the fields of the relationship that you want to use, scroll through them and single-click a field to highlight it. Here, CompanyID is already highlighted on both sides of the relationship, as these contacts are “children” of their “parent” company record.

Here’s what the checkboxes at the bottom of this dialog do.

When deleting a record in this file, also delete related records
If this box is checked, deleting the master record will delete all related records. For instance, if you delete a company record, all related contact records will be deleted too. You may want this to happen sometimes (for example, when deleting an invoice you can probably delete its related line items), but be careful when checking this box: The related records are deleted without warning.

Allow creation of related records
If this is checked, you can put your cursor into an enterable field in the portal and type in a related record. When unchecked, a portal to a related database is read-only.

Sort related records
Checking this box and clicking the Specify button brings up the following Specify Sort dialog:

Sort related records

Use this dialog to specify how related records will be sorted in a portal. For example, for the relationship to Contact.fp5 that we looked at above, the related records will be sorted by last name first, then by first name, in ascending order.

To specify the sort for a relationship, single-click a field in the left portal, then select “Ascending order” (A to Z), “Descending order” (Z to A), or “Custom order based on value list” (which sorts related records in the same order as the selected, predefined value list), then click the Move button. The field will move to the Sort Order box. You can also specify how each field sorts by selecting a field in the Sort Order box and changing its method of sorting with one of the radio buttons.

When checked, the “Override field’s language for sort” option says to override the language of the field’s index.

Normally, you’ll keep the language set to your language (English, for example), but you may want to change the language to ASCII, which takes characters like punctuation marks and other high ASCII characters into account in the sort.

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd Protection Status

File Maker Topics