Script Steps Reference

Table Of Contents
Fields script steps
F
ILEMAKER SCRIPT STEPS REFERENCE 77
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
Identifies the target field (National Statistics or World Statistics) based on geographical location,
then enters a calculated value (the sum of all Grand Totals) in the target field.
Set Field by Name [If ( Customers::Country = "Japan" ; Customers::National
Statistics ; Customers::World Statistics ); Sum ( Invoices::Grand Total )]
Example 2
Demonstrates when to use Set Field By Name instead of Set Field to simplify scripts.
#With Set Field, an If statement with multiple Else If steps is needed
#to determine which field on the Customers table to update
#with information from Credit Collection::Phone Number.
If [Credit Collection::Call Location = "Work"]
Set Field [Customers::Work Phone; Credit Collection::Phone Number]
Else If [Credit Collection::Call Location = "Home" ]
Set Field [Customers::Home Phone; Credit Collection::Phone Number]
Else If [Credit Collection::Call Location = "Mobile" ]
Set Field [Customers::Mobile Phone; Credit Collection::Phone Number]
End If
#A single Set Field by Name script step can perform the same task
#by using a calculation to determine the target field.
Set Field by Name [GetFieldName ( Evaluate ( Credit Collection::Call
Location & " Phone" ) ); Credit Collection::Phone Number]