By Daniel Wood, 31 January 2012
We had a great response to our first article with readers submitting their own favorite layout mode tips - a huge thank you to everyone who contributed. If you have any cool tips for the relationship graph we'd love to hear and share them, be sure to leave a comment with your favorite tips and hints.
How do you get to the relationship graph? Well the obvious way is via the Manage Database dialog (File -> Manage -> Databases). Incidentally, if you are not using the cmd+shift+D (ctrl+shift+D on windows) shortcut to get here then shame on you - this should be the first FileMaker shortcut you should learn!
There are actually many other areas in FileMaker from which you can enter the relationship graph, and these areas are actually far more powerful a means of accessing the graph than Manage Database. It took me (Daniel) a couple of years of neglecting these access points to eventually realise that I should be using them all the time, and now I do!
Ever seen the option below when setting up a value list?
Or this when specifying a field on a layout?
Or even this when choosing a field in a calculation?
These are all links to the Manage Database dialog. Depending on the context from which you follow this link, you will either be taken to the last tab you were on when you last visited the Manage Database dialog, or directly to the relationships tab.
In all of the examples above the key context is the need to select a field, be it for the value list, the field on the layout, or in the calculation.
However FileMaker is very smart, and it knows that we entered the Manage Database dialog from this specific point. It knows that if we create a table occurrence when in the dialog, then there is a good chance we have created it because we need it in the original context.
FileMaker will automatically select the last created table occurrence for you when you leave the dialog, if entered from one of these special "Manage Database" links.
As a classic example, let's say we are creating a value list. The value list is to be based on a related field value from a given context. We have the initial context, but we have forgotten to establish a relationship to the related context. Rather than cancel out of all the dialogs to this point (and thus losing our work), we can instead go direct to the Manage Database dialog via the value list.
From here, we can add the relationship required for the value list
When we press OK, FileMaker knows we added the table occurrence, and so we likely wish to use it in the value list. It automatically selects the table occurrence for us so we can continue to build the value list.
If we are already in the Manage Database dialog, perhaps editing a field calculation, we can still use the "Manage" shortcut, however in this situation it is a link to "Manage Relationships" instead of "Manage Database".
FileMaker prevents us from accessing more than 1 Manage Database dialog at a time, but it does let us access the relationship part of the dialog via a separate window.
You'll notice this window is purely for the relationship graph - there is no tab for tables or fields at the top. There is also no cancel or OK button, simply a close. This dialog works the same as the other access points. Upon pressing close, FileMaker will use the last created table occurrence back on the preceding dialog.
While not really obvious from looking in the relationship graph, there are in fact a number of really cool and useful shortcuts available. Refer to this link for a full list of shortcuts available. Below are some cool uses for these shortcuts.
If you use the anchor-buoy method of designing your graph then there may be times you need to select an entire table occurrence group. The simplest way is to start by selecting the anchor, and using the cmd+Y (ctrl+Y on windows) shortcut to progressively select table occurrences more and more levels away from the anchor. Just repeatedly tap the cmd+Y key a few times to quickly select the entire TOG. You could now use cmd+T to expand the entire TOG if you wish.
Sometimes a common problem on large or messy graph is the inability to locate a particular table occurrence you want.
You can start by trying to type the name of the table occurrence if you know it and this can be all you need in some cases. If your table occurrence has a long name or contains spaces then it can be difficult to type the name fast enough to find it. If you found at least 1 result then you can use Cmd (ctrl) + G shortcut to cycle through the full list of found matches until you find the one you were after.
If that doesn't work, try using the cmd (ctrl) + U shortcut. Start by selecting a table occurrence whose underlying table is the same as the one you want to find. Can't find a table occurrence? Then just add one temporarily for this purpose. Select it and use cmd+U. Now zoom out of the graph and focus just on the highlighted table occurrences.
An application we often use here is 2empowerFM Developer Assistant which among other things is great for locating Table Occurrences on the graph.
Finally you can just print the graph. The Print button is located in the lower left corner of the relationship graph. When printing, you have the option to print the graph on a single page or multiple pages - either option is good.
Instead of printing it, generate a PDF instead using the Preview/Save as PDF option from the print dialog (and the windows equivalent).
Now you can search the graph using your PDF reader instead of FileMaker. This is actually not a bad idea for large graphs as FileMakers search tends to get significantly slower with an increased number of table occurrences, whereas the PDF readers tested perform fine.
The other benefit of using a PDF reader like Preview, is that it can be easier to quickly see and scroll through all found results.
When forming a relationship between two table occurrences, don't waste time dragging the relationship line directly onto the field you want in the source and destination table occurrences - you'll be there all day waiting for the fields to scroll!
The quickest way to add a relationship is to drag the relationship line from any field on the source side to any field on the destination side. Then use the edit Relationship dialog to correctly choose the fields required. Be sure to use the type-ahead functionality provided to quickly locate the fields. If you need to expand table occurrences in order to drag the relationship line, use the shortcut cmd (ctrl) + T to expand both table occurrences at the same time. You can then use it again afterwards to collapse them at the same time - every second counts !
This is the number one thing you can do for your graph to boost productivity and decrease development time. A tidy graph is a happy graph. Try to avoid overlapping relationship lines and keep some kind of logical layout to your table occurrences.
Remember, the alignment tools are your friend, just as they are when working in layout mode. They work very much the same way - with the exception of there being no shortcut keys (Shame on you FileMaker!).
A bug that presented itself in FileMaker 10 and has persisted until this day concerns the alignment tools in the relationship graph. If you entered the graph from a layout that is in browse mode, and are using a custom menu, then the alignment tools are going to be greyed out and unavailable. You should ensure that you are in layout mode first, or switch your custom menu. Here's hoping FileMaker will fix this in future!
Comment boxes need not just be used for comments. We also use them as dividers that separate table occurrence groups, or logical sections of the graph. Particularly useful in anchor-buoy systems is adding a large comment above the TOG to indicate its purpose, or the screen it pertains to. This makes locating TOGs on the graph much easier. For large graphs, make the text size big so you can still find TOGs when zoomed out.
If you prefix your TOG labels with something standard - such as "zzz" - then searching for a particular TOG becomes a cinch. Use the graphs search functionality - it looks for comments as well as table occurrences!
Much like creating objects in layout mode, there are a few ways to create table occurrences on the graph. Firstly, you could use the provided button to add a table occurrence from scratch. A duplicate button is also provided - select a table occurrence and then use the button to duplicate.
Our favorite method however is option (ctrl) + Drag to create table occurrences. When using the option+drag method, the edit table occurrences dialog does not appear automatically after the duplicate is created. This is really handy, because often you want to position the table occurrence first.
Using a naming convention is a great way to assign names to your table occurrences to keep everything in order, and make it easy to identify a table occurrences purpose, and its associations. There are many different conventions out there and everyone has their favorite.
Often naming conventions are such that in order to add a new table occurrence it is easiest to create a duplicate of the table occurrence it will be related to. You can then change its underlying table and rename it by changing a few parts of the table occurrence name.
Above I have created a duplicate of a table occurrence that I wish to establish a new relationship from.
If I go directly into the table occurrence setup and change the underlying table, you'll notice that the table occurrence name has reverted back to the table name. This happens upon entering the dialog and making no changes to the occurrence name. Once you make any change to the table occurrence name, it will remain as-is when you change the table.
So the tip here is, change your table occurrence name first before changing the table. Another good habit of getting into is copying the occurrence name to clipboard when entering this dialog. Tab followed by cmd (ctrl) + C will put it on the clipboard. Then if you change the table it doesn't matter if it gets overwritten as you can paste it back in.
Every second counts so if you can reuse any existing table occurrence name then it is worth doing.