Script Steps Reference

Table Of Contents
FILEMAKER SCRIPT STEPS REFERENCE 54
If the result of the calculation doesn’t match the target field type, and the validate option for
the field is set to Always, the field will not be set and an error code is returned (which can
be captured with the Get(LastError) function).
When possible, the Set Field 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 script steps should
group these steps together if possible, so that subsequent Set Field 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 script step. These functions and record level validation
are performed after the record has been exited or committed.
If the target field is a repeating field, you can specify a repetition number or generate a
repetition number from a calculated expression.
Examples
The following example calculates 7 percent of the Salary field and assigns the result to the field SDI.
Note that Set Field works whether or not the field is on the active layout.
Set Field [Table1::SDI; Salary * .07]
Related topics
Script steps reference (alphabetical list)
Contents
Set Field By Name
Purpose
Replaces the entire contents of a calculated target field in the current record with the result of the
calculated value.
Format
Set Field By Name[<calculated target field>; <calculated value>]
Options
Select Specify target field or click Specify to create a calculation to specify the field whose
contents you want to replace. In the Specify Calculation dialog box, use the field list (on the
left) and the functions list (on the right) with the mathematical and text operators to build the
calculation.
For Calculated result, click Specify to define the calculated value.
Compatibility
Where the script step runs Supported
FileMaker Pro Yes
FileMaker Server scheduled script Yes
FileMaker Go Yes
Custom Web Publishing Yes
Instant Web Publishing Yes