Database Reference
In-Depth Information
▪ When you use a script step that inserts data into a field (and leaves someone in the field),
then FileMaker locks the record when the step runs but doesn't commit the change. You
can then do more work with fields if you want. FileMaker commits the record later, when
the user exits the record.
▪ If your script changes to a different layout, switches to Find or Preview mode, or closes
the window, then FileMaker automatically commits the record if needed.
▪ If you use a script step that modifies several records— Replace Field Contents , for
example—FileMaker commits the records in batches as it goes. When it's finished, every
record that was modified is committed.
▪ If you perform a series of Set Field steps in a script, and you're not in the record when
the script runs, then FileMaker locks the record and makes the field changes. When the
script is done, you're not in the record (no field is active), but the record is still locked
and uncommitted. In other words, you can use the Records→Revert Record command to
revert all the changes made by the script, which probably isn't what you want. Add a
Commit Records/Requests script step at the end of the script to avoid losing the data
your script enters.
▪ If your script changes some records and includes a step to revert them if something goes
wrong, then you should probably make sure to commit any changes someone was mak-
ing before your script changes anything. That way, the script doesn't undo any of her
work. Thus, put a Commit Records/Requests step at the beginning of your script.
And if you're still not sure if your script really needs an Open or Commit step, go ahead and
open the record at the beginning of your script and commit it at the end. Sure, it takes a nano-
second or two extra to run a couple of steps that may not be strictly necessary. But what's a
nanosecond on the grand scale of time when your data may be at risk?
Copying Records
FileMaker has two record-related script steps that do something you can't easily do manually
in Browse mode: Copy an entire record to the Clipboard. One version copies just the current
record, while the other copies every record in the found set at once.
Copy Record/Request
The first, called Copy Record/Request , works on one record at a time. It copies data from
every field on the layout and puts it on the Clipboard. FileMaker puts a tab character between
each field value. Then you can switch to another program, like Word or Mail, and paste the
data from the record. Since there are tab characters in the copied data, you may need to
format it or manually delete the tab characters.
Search WWH ::




Custom Search