Database Reference
In-Depth Information
Merge Variables
Merge fields are dandy, but FileMaker has another cool way to create layout text that
changes under certain conditions: the merge variable . A variable is like a temporary field
you can create with the Set Variable script step. You can choose from two kinds of variable,
but if you want to use yours on a layout, it's got to be a Global variable. Global variables
have two dollar signs at the start of their names, $$dayOfWeek for example. Here are the
steps to create a variable that displays the current day of the week on a layout:
1. Go to Scripts Manage Scripts .
The Manage Scripts dialog box opens.
2. Click New to create a new script, and name it Set Merge Variable . From the list of
script steps on the left, double-click Set Variable .
FileMaker adds this step to your script and automatically selects it.
3. Near the bottom-right side of the window, click Specify .
The Set Variable Options window appears.
4. In the Name field, type $$dayOfWeek . In the Value field, enter the following for-
mula and then click OK to save it :
DayName ( Get ( CurrentDate ) )
5. From the list of script steps on the left, double-click Refresh Window. This step
ensures that when your variable is set, the change will show up onscreen right
away. You can ignore the two checkbox options that appear when the Refresh
Window step is selected .
6. Close the script window, being sure to save it when asked and then close Manage
Scripts .
You're back on your layout.
7. Select the Text tool and then click a blank spot to create a text box. Choose In-
sert Merge Variable .
FileMaker inserts “<<$$>>” and places your cursor just after the dollar signs.
8. Carefully type dayOfWeek just as you entered it when setting the variable back in
the script definition .
Spelling counts here.
9. Switch to Browse mode .
Search WWH ::




Custom Search