Script Steps Reference
Table Of Contents
- Contents
- About script steps
- Script steps reference (alphabetical list)
- Control script steps
- Navigation script steps
- Editing script steps
- Fields script steps
- Set Field
- Set Field By Name
- Set Next Serial Value
- Insert Text
- Insert Calculated Result
- Insert From Index
- Insert From Last Visited
- Insert Current Date
- Insert Current Time
- Insert Current User Name
- Insert Picture
- Insert QuickTime
- Insert Object (Windows)
- Insert File
- Update Link (Windows)
- Replace Field Contents
- Relookup Field Contents
- Export Field Contents
- Records script steps
- Found Sets script steps
- Windows script steps
- Files script steps
- Accounts script steps
- Spelling script steps
- Open Menu Item script steps
- Miscellaneous script steps
Fields script steps
F
ILEMAKER SCRIPT STEPS REFERENCE 45
Example 1
In the following example, a calculation identifies the target field in which a value should be replaced
based on the geographical location in which the data was entered. Then the script enters a
calculated value in the target field based on the appropriate currency exchange rate.
Set Field By Name
[If (Members::Country = "USA" ;
Members::Fee Paid-USD ; Members::Fee Paid-GBP);
If (Members::Country = "USA" ;
Members::Fee*<USCurrencyRate> ;Members::Fee*<GBCurrencyRate>;
Example 2
The following example replaces the contents of the Country field located in Table1 with the data
located in the Name field in related Table2.
Set Field By Name["Table1::Country";Table2::Name]
Note To ensure proper evaluation, FileMaker Pro must treat the target field as a literal string.
Therefore, you must include quotation marks around the calculated target field.
Example 3
The following example evaluates the global target field Location::fieldName, then replaces the
contents of fieldName with the data value located in the Name field in related Table2.
Set Field By Name[Location::fieldName;Table2::Name]
Note The context for the calculation (determined in the upper left corner of the Specify Calculation
dialog box) is essential for proper evaluation.
Example 4
The following example uses the GetFieldName function to ensure that FileMaker Pro retrieves the
fully qualified name of the target field and the Evaluate function to extract the value stored in the
target field, then replaces the contents of fieldName with the data value located in the Name field in
related Table2.
Set Field By Name
[GetFieldName(Evaluate(Location::fieldName));Table2::Name]
Set Next Serial Value
Purpose
Resets the next serial value in an auto-entry serial number field.
Format
Set Next Serial Value [<table::field>; <value or formula>]