Script Steps Reference
Table Of Contents
- Contents
- About script steps
- Script steps reference (alphabetical list)
- Control script steps
- Perform Script
- Pause/Resume Script
- Exit Script
- Halt Script
- If
- Else If
- Else
- End If
- Loop
- Exit Loop If
- End Loop
- Allow User Abort
- Set Error Capture
- Set Variable
- Install OnTimer Script
- Navigation script steps
- Go to Layout
- Go to Record/Request/Page
- Go to Related Record
- Go to Portal Row
- Go to Object
- Go to Field
- Go to Next Field
- Go to Previous Field
- Enter Browse Mode
- Enter Find Mode
- Enter Preview Mode
- 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
- 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 32
Description
Suppose you have an Invoices table that's related to a Customers table and you're currently looking
at a particular invoice. In the Invoices table, you have a button that's set to Go to Related Record
[Customers]. Clicking this button determines which customer record your current invoice is related
to and immediately goes to that record in the Customers table. If the record in question is not
currently in the Customers table’s found set, the script can perform a find to make the record
current.
Tip If the related records cannot be found, this script step returns an error code which can be
captured with the Get(LastError) function.
This script step also works with portal rows. If this script step is used from an active portal row, and
the portal’s table is the related table, then the related record in that table is made current. If the
portal’s table is not the related table, the first related record in the found set is made current.
When used with a table in an external file, this script step will open the file containing the external
table and, if selected, go to the external layout you specify.
There are situations in which a script containing the Go to Related Record script step could modify
an unintended set of records. For example:
• If the related records cannot be found, this script step remains on the current layout.
• If you select a table occurrence to which there’s no relationship, or a layout that doesn’t
refer to the correct table occurrence, FileMaker Pro displays an error message. After the
error message displays, script execution continues with the next script step.
• If there are no related records or no record in the active portal row, the script might produce
unexpected results. Use the IsEmpty function to determine if there are no related records
before using Go to Related Record.
• If you have Allow creation of related records enabled and Go to Related Record is
executed from an empty portal row, the script might produce unintended results.
Notes
• The sort order is not maintained if the related records are in an external file.
• If you are filtering records in a portal, this script step exposes all of the records, not just
the filtered records.
Examples
The following goes to a related record in the table "MyRelatedTable".
Go to Related Record [From table: "MyRelatedTable";
Using layout: “MyLayout”]
The following goes to a related record in the table "MyRelatedTable" and shows a found set of
related records only.
Go to Related Record [Show only related records;
From table: "MyRelatedTable"; Using layout: “MyLayout”]
Related topics
Script steps reference (alphabetical list)
Contents