I presented these demo files during a series of user group meetings in the Bay Area. My goal for each demo file was to incorporate the technique into an existing solution and think of it outside of the box.
In this sample file, there are two applications of Snapshot Link:
- Launch file
- Bookmark when closing
For the launch file, open up the solution. Once you’re at the opening screen with the “About” and “Demo” buttons, create a Snapshot Link and place it on your desktop. As long as the file doesn’t move, the Snapshot Link on the desktop can serve as your launch file.
For the bookmark, there is a script called “On Close” that runs when the file closes (via File > File Options). It shows a dialog and asks the user if his place should be saved. If the user agrees, the script puts a Snapshot Link to the desktop, that the user can click to start off where the database was last left.
Demo File: Snapshot-Link
In these sample files, there are two treatments of Filtered Portal:
- New approach to tab control
- Report management
It’s common to create a solution with tab controls, but what if you wanted to change the look? The layout “Sample Menu | Tab no Hierarchy” shows you how a filtered portal can enhance the user experience and control the tabs. This technique takes a combination of the following:
- Hidden Tab Control (Fixed Width of tab = 0) where each tab has an object name
- The table “Tab” that stores the tab display name, the menu group, the sort order, and the object name for each menu.
- The script “SwitchTabs” takes the user to the correct object based on the object name stored in the Tab table.
The layout “Sample Menu | Tab” takes the technique to the next level, allowing a hierarchy of parent and child. The added tools for this technique work include:
- A field in the table “Tab” called “Belongs To” that ties each record to its parent record
- A global variable that contains the “Belongs To” value for the filtered portal
The other sample file for filtered portals shows how to use a filtered portal with global fields. Not only is the user interface clean, but the user has control over which reports he can see. You’ll notice the “Not isEmpty( )” in the Filtered Portal calculation. One of the things I’ve learned over time is that if the user selects nothing in a filter, he or she wants to see everything. It is counterintuitive but the expected behavior. Filtered Portals require quite a bit of trial and error.
Demo File: Filtered-Portal
The latest version of FileMaker Pro introduces a few new triggers. In these sample files, there are several purposes for Script Triggers:
- OnViewChange – Changing views (meaing layouts) with the Toolbar
- OnObjectValidate – Providing feedback for erroneous data
- OnObjectKeystroke – Limiting keystrokes and characters
In the first sample file, the script “Change in Views” is being triggered by OnView Change. If the user clicks on the “list view” from the toolbar, the script is executed, taking the user to a layout with the same data in a list view. The same applies in table and form view. The important part of the technique is consistency in the layout naming. Each one ends with the word that defines the layout view.
In the second sample file, there are three examples:
- OnObjectValidate – Allowing a range based on the script parameter (Example: 1 to 10)
- OnObjectKeystroke – Not allowing the user to type anything but positive numbers (including the decimal point)
- OnObjectKeystroke – Not allowing the user to type anything but numbers (including the dash for negative numbers)
There is also an example involving the drop-down. One of the things my user discovered was the ability to type into the field if the drop-down wasn’t showing. By using OnObjectKeystroke, the user is limited to what keystrokes will occur.
However, it is important to note that individual keystrokes are allowed, even though they don’t produce a character. These keys include backspace, return, escape, and arrow keys. Removing these from the user’s capabilities would leave the user feeling handicapped instead of improving the interface.
Demo File: Script-Trigger