FileMaker Navigation – Go to Layout Script

This is a demonstration of a simple navigation system. FileMaker has had layout tab objects for a while and they are great, but in many solutions you actually want to move between layouts to view different data tables. I show the way I like to do it and then an alternative that works in some situations.

Download Demo File

Layout 1) Company


This is a very simple solution with no fields and a couple of scripts for demonstration purposes.

Layout 2) Contacts


Layout 3) Sales


Go to Layout script


There is a single script attached to each button. The only difference between each button is a different Script Parameter.

The ‘Go to Layout’ Navigation Script


The script itself is called “Go to Layout”. Lately, I have been adding a New Window step if the Option key is held down. Many times I find myself wanting to keep the current view and see something else in a different window, rather than having to flip back and forth.

Some of the advantages of a script like this are that you can keep repetition to a minimum, for example the New Window idea and the Adjust Window step at the end are used only once. If we broke this down into many scripts, all those steps would be repeated for each script. Centralizing the navigation into one or a few scripts also allows you to add additional security or data verification steps as well. This only has to be done once, rather than in many scripts.

#Opens a new window if the Option Key is held down. This is handy when you want to keep multiple items in view.
If [ Get ( ActiveModifierKeys )=8 ] New Window [ ]
Set Variable [ $CurrentLeft; Value:Get ( WindowLeft ) ]
Set Variable [ $CurrentTop; Value:Get ( WindowTop ) ]
Move/Resize Window [ Current Window; Top: $CurrentTop+100; Left: $CurrentLeft+100 ]
End If

If [ Get(ScriptParameter)=”Company” ]
Go to Layout [ “Company” ]
End If

If [ Get(ScriptParameter)=”Contacts” ]
Go to Layout [ “Contacts” ]
End If

If [ Get(ScriptParameter)=”Sales” ]
Go to Layout [ “Sales” ]
End If

Adjust Window [ Resize to Fit ]

Another approach


For a really simple navigation system, where you are not likely to change the names of the Layouts, you might consider using the calculated Go to Layout step. You could add conditional steps after the Go to Layout step to do different things depending on which layout you arrived on.

Layout Name by Calculation…


I was demonstrating this basic technique to a new FileMaker programmer recently and he asked about employing the Layout Name by Calculation would shorten the script. While this is true and would work in more limited situations, it can be problematic. If the layout name gets changed, you as the programmer are forced to go back to all the buttons on all the layouts and change the Script Parameters on each button. Using the Go to Layout selected approach, if the Layout Name gets changed it will automatically be updated in the script—no need to go back to the buttons and change anything.

In this alternate approach, Instead of selected a fixed layout, you choose the option for ‘Layout Name by Calculation…”

The calculation is the Script Parameter sent from the button


The downside of this approach is that if you change the name of your layout, you have to go back through all the buttons and update the Script Parameter. I prefer the previous method of selected a fixed layout in the Go to Layout option.

Applying the technique to layout objects – Setting up the buttons


Select a button

Right click the button


Right click on the button or from the Format Menu select “Button Setup…”

Select the Go to Layout script


Click the Specify button to choose a script to run when the button is clicked.

Set the Script Parameter to be the Layout Name


Another benefit of using the Script Parameters and a fixed layout is that you can run a security challenge before going to the layout. Using the Layout Name by Calculation approach, you are already on the layout before you can do any testing.

That’s it. This is the basis for a simple navigation system that can be used throughout your database. You may want to break the script up into a few functional areas if your script gets really long.



  1. FileMaker Navigation – Go to Layout Script | Homebase Software | Filemaker Info - March 25, 2014

    […] See on […]

%d bloggers like this: