FileMaker 17 has a great new feature for creating “Master-Detail” layouts. With this feature, you can create a new type of portal this is a bit different than the regular portals we are all used to using. It’s super-slick, and super easy to create. In this article, I’ll explain what Master-Detail is, how to create a Master Detail layout, and how these new portals are different.
What is Master-Detail?
Master-detail often refers to a parent-child type of relationship between 2 tables. For example, an Invoice with multiple line items, or a Contact record with multiple phone numbers. Other platforms, such as Salesforce, have a special type of relationship between 2 tables called a Master-Detail relationship.
In this case, Master-detail refers to a common user-interface feature where you see a list of items. If you click on an item in the list, the details are then displayed for that item. A good example of this is an email App where you see a list of email messages on the left. When you select a message, the message details appear on the right.
In Apple’s Developer documentation, they gives some guidelines for creating this type of User Interface (UI).
When talking about Master-Detail in FileMaker, this traditionally refers to a UI feature where you can select a row from a portal to see details about the record the portal row represents. There is typically a portal on the left side of the layout that displays all of the “master” records. When you click on a row in the portal, the “details” of that record will display on the right side of that layout. Here is an example:
Usually there is just a single table involved with a “self-relationship” from the table to itself. For example, in a Contacts layout the portal will display a list of “related” contact records from the same base table. If you click on a portal row, you can run a script or script step that performs a Go To Related Record (GTRR) script step to navigate to that record. There are many other ways to accomplish this as well.
How is this any different now in FileMaker 17?
FileMaker 17 has a new portal option. You are now able to create a portal that displays records that are in the current found set. Here’s how to do it.
First, create a new layout. On your newly created layout, use the portal tool to draw a portal.
In the Portal Setup dialog, from the “Show records from:” dropdown, choose Current Table. Prior to FileMaker 17 you could only create a portal from a related table. But now you can create a portal from the current table.
You’ll notice here that the check boxes for sorting and filtering the portal are grayed out. In this type of relationship, you cannot use the Portal Setup Dialog to sort or filter the portal.
Click OK.
Add your fields to the portal.
After your portal has been added to the layout, add fields to the right of the portal that show additional details.
Now, create a few records and add information. As you add records, you will see new rows added to the portal.
Click on a few different rows in the portal, and you will see the details change – with no button, script, or relationship needed! The navigation is built right in.
Next, do a search, say, by First Name starting with a certain letter or letters. The portal will reflect the results of the search, in unsorted order, and only display records that are in the current found set.
Search Results:
To sort the portal, simply sort your found set of records. Voila!
The other thing you might notice is that no extra table occurrence is needed or created when this portal is created. No new relationship is needed to make this work!
If you want the records to always remain in sorted order, you could set up an OnModeEnter script trigger (in Layout Setup) to sort the found set of records after a Find is done. Just make sure to uncheck the boxes for Find and Preview modes so the script only triggers when entering Browse mode after the search is completed.
This new type of portal makes creating Master-Detail layouts super-simple. Not only do they show records in the current found set, but the portal can be sorted according to how the found set of records is sorted. Try it out. It’s powerful and easy to use.