Database Reference
In-Depth Information
row, then it
doesn't
fire again. But if you click a field on a
different
row, then it fires again.
This is a good way you can track someone as she switches from row to row.
For a web viewer, the trigger fires if you click into the web page or tab into a field on the
page.
OnObjectKeystroke
Once you've entered an object, it can track keystrokes by using an
OnObjectKeystroke
trig-
ger. When you press a key on the keyboard, the trigger fires
before
the keystroke is entered,
which means it can be canceled.
OnObjectKeystroke
triggers are used to prevent data entry
in a field. Usually the script looks for certain characters and then refuses to enter them. For
example, you could disallow all data except numbers and the hyphen character in a Social
Security Number field. You'll see an example of limiting data entry on
Creating a Keystroke
OnObjectKeystroke
can be applied in Browse and Find modes. When attached to fields, the
script runs repeatedly as you type or arrow around in the field. It also fires when you press
the Tab key or Enter key to leave the field. For buttons and tab controls, you have to tab into
the object for it to receive keystrokes. Since most people don't expect to type in a button or a
tab control, you'd rarely use
OnObjectKeystroke
on them. Portals and web viewers never
receive keystrokes, so this trigger never fires if you assign it to one.
OnObjectModify
The
OnObjectModify
trigger is frequently used to prevent data entry into a field. For ex-
ample, you might want users to be able to enter or edit data in a Print Date field up until the
date in the field. But once that date has passed, you don't want to allow any more data entry.
An
OnObjectModify
trigger can run a script that compares the field's date to the current date
and then taken the proper action. The trigger fires
after
data in the field changes but
before
you've exited the field
. For instance, if you type into the field, then the trigger fires each time
you add or delete a character. But it
doesn't
fire if you just use the arrow keys to move
around in the field, or if you press Tab, Return, or Enter to leave the field. It also fires once
each time you cut or paste in the field. It's available for Browse and Find modes.
On a tab control,
OnObjectModify
fires when you switch tabs. This behavior has been re-
tained in FileMaker Pro 13, so if you used it in earlier versions you won't have to find and
change all your tab control script triggers to the new
OnPanelSwitch
. But since its behavior
is clearer, your new databases should use
OnPanelSwitch
instead.
OnObjectModify
never
fires with buttons, portals, and web viewers.