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 From URL
- Insert Current Date
- Insert Current Time
- Insert Current User Name
- Insert Picture
- Insert QuickTime
- Insert Audio/Video
- Insert PDF
- Insert File
- Replace Field Contents
- Relookup Field Contents
- Export Field Contents
- Records script steps
- New Record/Request
- Duplicate Record/Request
- Delete Record/Request
- Delete Portal Row
- Delete All Records
- Open Record/Request
- Revert Record/Request
- Commit Records/Requests
- Copy Record/Request
- Copy All Records/Requests
- Import Records
- Export Records
- Save Records As Excel
- Save Records As PDF
- Save Records As Snapshot Link
- Found Sets script steps
- Windows script steps
- Files script steps
- Accounts script steps
- Spelling script steps
- Open Menu Item script steps
- Miscellaneous script steps
FILEMAKER SCRIPT STEPS REFERENCE 55
Originated in
FileMaker Pro 10.0
Description
The Set Field By Name script step lets you create a calculation to specify a field name, then change
the value of the field either literally or based on a second calculation.
The calculated target field must return a text result.
If quotation marks are not included around the fully qualified field name, the target field name is
obtained from the named field.
If no field is specified and a field is selected in Browse mode or Find mode, that field is used.
Notes
• The specified field doesn’t have to be on the current layout.
• Set Field By Name ignores validation checking.
• When possible, the Set Field By Name script step makes the record active and leaves it
active until the record is exited or committed. Scripts that use a series of Set Field By Name
script steps should group these steps together if possible, so that subsequent Set Field By
Name script steps can act on the record without having to lock the record, download and
upload data, index the field, and so on, after each individual Set Field By Name script step.
These functions and record-level validation are performed after the record has been exited
or committed.
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 replaces the contents of the global target field with the data value located in
the Name field in related Table2.
Runtime solution Yes
Where the script step runs Supported