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.
Something to say? Post a comment...
Comments
Finn Mulhall 29/10/2013 3:37pm (11 years ago)
The search issue in the relationship graph can be overcome by using an Automator service. This gives you a simple tool to find any table by name in the relationship graph. check out http://finnjmcode.blogspot.com.au/2013/10/filemaker-search-relationship-graph.html
Jonathan Fletcher 16/09/2013 1:20am (11 years ago)
One more thing about accessing the schema is that you can do it while running a script in the debugger. (Hmm, really?)
Yup. While you can't choose Manage Database from the menu, because it is deactivated, you can bring up the script (second button from the right at the top of the Debugger window). You can edit the script to your heart's content. It's just when you attempt to save it that it asks you if you want to halt the running script.
Now, while in the script you can do anything you want to it, including edit calculations, which just so happens to give you access to Manage Database, through Daniel's tip above. Obviously, there's along list of caveats when doing this on a live solution, but for development it is quite handy.
My absolute favorite non-obvious use of Developer Assistant (mentioned in the article) is to test the calculations in the schema (using DAs awesome Evaluate feature) while the script is running to find out why it returns an unexpected value WITHIN THAT CONTEXT. (Something the Data Viewer can only dream of.)
If you are serious about developing in FMP you first buy FMPA and within the next few minutes after that purchase you buy Developer Assistant. Just do it.
Steven James 16/09/2013 12:24am (11 years ago)
Does anyone have any tips for how to clean up a very messy and very large relationship graph?
How to begin thinking about the problem...? and/or.. are there any tools to help with this?
Daniel Wood 01/02/2012 6:51pm (13 years ago)
Cheers for those awesome tips Matt - I didn't know about the option-click for deleting TO's but I'll be using it all the time now :-)
Matt Petrowsky 01/02/2012 4:05pm (13 years ago)
Oh, and if you don't want to zoom in and out. Just use Command-I to "Inspect" the whole world view of your graph. :)
Matt Petrowsky 01/02/2012 3:59pm (13 years ago)
Great article Daniel!
Another great tip for working with graph elements is that the same keys which work with layout objects in Layout mode will work in the Graph. Primarily the Cmd key (and Windows equivalent) for "pass-over" marquee selections - instead of having to completely encircle selected TO's just hold Command and pass over any TO's you wish to select.
Bulk actions are helpful too. Select as many TO's as you wish and click the collapse/expand widget in the upper right hand corner of any selected TO. This will toggle the state of all selected TO's - a great thing to do once your graph is close to being solid.
And one of my most favorite all-time time-savers is the wonderful "Option key delete" feature. Tired of seeing those silly delete prompt dialogs for TO's - because you already know you really want it deleted - try holding down the option key (or Win equivalent) and hit that Delete key. Tip: works in many other areas too. ;)
And finally... Don't forget Command-N for a new note (make lots of them!) and Command - (minus) or Command + (plus) for zooming in and out.
Matt Petrowsky
www.filemakermagazine.com
Mardi Kennedy 01/02/2012 11:44am (13 years ago)
For while I preceded my 'worker fields', ie sn, dates etc with and underscore so they popped to the top of the alphabetically listed fields. I've since learnt that this is a total pain if you're using the SQL engine as it doesn't play nice at all with a field whose name begins with an underscore. Thus, an alternative like 'aa' or 'a_' is better. Hope this helps someone else fumbling through the SQL debug nasties.
Daniel Wood 01/02/2012 10:26am (13 years ago)
Hi all, thanks for the comments and tips.
Hal: We like it too :) We find using full words makes it easier to quickly see a TO and be able to understand it - 100 characters for a TO name is more than enough (providing you keep your chains of TO's small, which is certainly achievable).
Dennis: Pretty much what Bruce & Jonathan mention. the z can be useful for TO organising to make it easy to locate TO's when specifying a field, calc etc. We use it for developer-related TO groups, and developer/meta data fields. We prefer field name order for fields as opposed to custom order, probably because its just the way we have always done it. It does mean there is no fear of losing your meticulously set custom orders of all your tables if someone happens to come along and sort by field name, then hit the OK button (if the file is offline that is).
the zzz on the graph for comments is to help searching for TOGs so that if you begin your search with zzz it will only be searching comments rather than TO names (providing you don't use zzz as a TO prefix).
Karen 01/02/2012 6:20am (13 years ago)
Could you NOT have posted this a day earlier? Discovered the alignment tools problem yesterday, and since Google was not my friend, I had to suss it out on my own! :) Great collection of tips, you have earned Home Page on my browser.
Lon Cook 01/02/2012 6:08am (13 years ago)
Good stuff Daniel!
Thanks for clearing up that bug with the alignment tools. I've observed it, knew to switch to layout mode, but didn't know the connection to custom menus.
My own tip: after you've spent all that time cleaning up and aligning your graph, you then need to move some TOs to make room. Rather than grab the TOs and move them about, select them, and use cntrl+arrow keys to move them, maintaining their alignment.
Jonathan Fletcher 01/02/2012 5:08am (13 years ago)
Bruce, your comment is correct, assuming that the developer maintains his lists in field name order. Matt Petrowsky and a few of his brethren (but not all) on the FileMaker Standards site advocate keeping your field lists in custom order so that you can have whatever organization you want, eliminating the need for alphabetical constructs for organization.
Bruce Herbach 01/02/2012 4:50am (13 years ago)
Daniel,
Very nice blog. Incredibly helpful.
Dennis,
By putting zzzz in front of a Table occurrence or field name, you are controlling where in the list they appear when selecting a field or TO. If you put characters like _ or ___ they will come up at the beginning of the alphabetical list. zzzz will come at the end.
I like to do this for key fields. So __kpID is a primary key and will be first field in the list, _kfID is a foreign key and will show up just below the primary key. The difference that does this is the number of _ characters. Without the _ character, kf would come before kp.
Bruce Herbach
Dennis Burnham 01/02/2012 3:25am (13 years ago)
I've never understood the rationale behind the naming convention of using zzzz characters to precede table occurrence and field names. Anybody care to explain that? thanks in advance.
Hal Gumbert 01/02/2012 2:19am (13 years ago)
I love your naming of TOs. We use periods instead of " to " and for the purpose we would type "FILTER" instead of " for Filter. Only reason is to make it a bit shorter...
For renaming TOs, if you type anything in the line like a space and then change the table it won't wipe out the name. That's one keystroke less... :)
Jonathan Fletcher 31/01/2012 6:34pm (13 years ago)
Good thing I took a screen shot of it to pull out when your success starts to go to your head! jk
[Hey, I put "eleven" in the captcha and it told me I was wrong! So is NZ on Ten or are you already on Twelve? ;;-) ]
Daniel Wood 31/01/2012 6:05pm (13 years ago)
Fists? What Fists? I know not of these fists you speak of ;) Great tip Lee!
Jonathan Fletcher 31/01/2012 5:44pm (13 years ago)
Wow, I don't remember the "fists" from the last article! ::-)
Lee Hoong 31/01/2012 5:19pm (13 years ago)
Another great set of tips! Keep 'em coming!
When using anchor-buoy, I keep the anchors flushed against the left edge of the RG so that when I need to move several pre-aligned buoys vertically, I select the buoys along with their anchor, then slide the anchor up or down, keeping it flushed along the left edge - this maintains the left/right alignments of the buoys relative to the other TO's.
No one has commented on this page yet.
RSS feed for comments on this page | RSS feed for all comments