Database Reference
In-Depth Information
FREQUENTLY ASKED QUESTION: TO SHOW OR NOT TO SHOW
How do I decide when to turn on “Show only related records” and when to leave it off?
If you don't turn on “Show only related records,” then FileMaker doesn't change the found set in the
target table unless it has to in order to show the proper record. In other words, if the target table is
showing all its records, FileMaker just makes the target record active without changing the found
set. All the records are still in the found set, and the user can flip through them to see records that
aren't related to the original record. But if the target table has a found set of records and your target
record isn't in the set, FileMaker has to change the found set to show the target record.
But when the “Show only related records” option is turned on, the found set in the target table will
always be related record(s) only. So use this option when you want to restrict the found set, either
for the users' convenience, or because the script must have a found set to do its work.
The tradeoff is performance. When you turn the “Show only related records” option off, FileMaker
just makes the proper record active. It doesn't worry about the found set or the sort order. When the
option is turned on, though, FileMaker has to find the correct records first and then show the one
you asked for. If your relationship is sorted, then FileMaker also sorts the records. If your script just
needs to visit a specific related record, do something to it and then come right back, you can leave
this option turned off to make your script run more quickly.
Whichever option you choose, you can avoid annoying your users when your untimely GTRR des-
troys their found set by choosing the “Show in new window” option. When you create a new win-
dow for the target table, your script won't tamper with the user's existing found set for the target
table.
Opening, Reverting, and Committing Records
When you use your database in Browse mode, FileMaker does a lot of things automatically.
When you start typing in a field, it locks the record. When you exit the record—click outside
any field or press Enter—it commits the record. When you use a script, though, you're not
really clicking fields and pressing Enter. So how does FileMaker know when to lock a record
and when to commit? You have to tell it, by including the appropriate script steps: Open Re-
cord/Request , Revert Record/Request , and Commit Records/Requests .
Open Record/Request
The Open Records/Requests step tells FileMaker you're about to start editing a record. If
the record is already open, then it does nothing—that is, it doesn't automatically commit the
record first. It just locks the record so no other user can edit it, if it isn't locked already. But
if the record is already open (by you, via another window, or by someone else), then you get
a record-locking error. (See The Set Error Capture Script Step to see how you can check for
errors while a script is running.)
Search WWH ::




Custom Search