Help

Table Of Contents
Creating and managing layouts and reports
F
ILEMAKER PRO HELP 249
could display the total cost at the bottom of an invoice, or display the name of the account used to
print a report.
You see the merge variable value in Browse, Find, and Preview modes, and when you print records.
To insert a merge variable onto a layout:
1. Create a variable using the Set Variable script step.
FileMaker recommends that you create global variables for use as merge variables.
2. In Layout mode, click in the layout where you want to insert the variable, then choose Insert
menu
> Merge Variable.
For example, insert a merge variable into a text block or by itself on the layout.
Do not insert merge variables over a field or any other object that you want to view.
A placeholder merge variable (<<$$>>) appears on the layout.
3. Click between the $$ and >> symbols in the placeholder variable, then type the merge
variable name (the name of the variable you created in step 1).
Important To ensure that merge values are displayed accurately, each record must be refreshed as
it is being browsed, previewed, or printed. You can refresh records manually by, for example,
creating a “Refresh”
button that calls the Refresh Window script step, or automatically by creating a
script that includes the Refresh Window script step.
Examples
To create a merge variable named <<$$acctname>>, which displays the name of the
user’s account, create the script step:
Set Variable[$$acctname; Value:
Get(AccountName)]
. Then, insert the merge variable <<$$acctname>> on the layout.
To create a merge variable named <<$$POnum>>, which appends the text “-MPO” to the
current record number to form a purchase order number, create the script step:
Set
Variable[$$POnum; Value: Get(RecordNumber)
& “-MPO”]. Then, insert the
variable
<<$$POnum>> on the layout.
To display the current page number with the total number of pages in a report (for example,
Page
1 of 10), start by creating a merge variable named <<$pp>>, and create the following
script for it:
Enter Preview Mode
Go to Record/Request/Page [Last]
Set Variable [$pp; Value:Get(PageNumber)]
Go to Record/Request/Page [First]
Pause/Resume Script [Indefinitely]
Then, combine text, the page number symbol ({{PageNumber}}), and the merge variable on
the layout header or footer:
Page {{PageNumber}} of <<$pp>>
Notes
A variable used as a merge variable cannot include the repetition (index) number of a
repeating field (as in the syntax
$variable[repetition]) or a file path.
To remove a merge variable, select the merge variable on the layout, along with the <<, $$,
and >> symbols, then press Backspace or Delete.