Database Reference
In-Depth Information
often reflexively hit the Return or Enter key when they see a dialog box. By making Cancel the de-
fault button, you can prevent potentially destructive processes when people fail to read your in-
structions. If you use this method all the time, you might even find that users start reading your dia-
log box messages to make sure they make the right choice.
When the dialog box appears, your script waits for a click of one of its buttons and then con-
tinues. FileMaker knows which button the user clicked, but your script should use an
If
test
with a
Get(LastMessageChoice)
function to see what happened. Then the script can branch
appropriately.
Get(LastMessageChoice)
returns
1
for the default button,
2
for Button 2, and
3
for Button 3. So your script will do the
Post Payment
script steps only if the function re-
Figure 17-5. This script asks a question using a
Show Custom Dialog
step, then an If statement
with a
Get(LastMessage Choice)
function decides what to do. If someone clicks Post, then the
function result is 2, and the script does whatever magic you create between the
If
statements. To
give users two choices, plus a Cancel button, your script needs an
If
statement that checks for a
value of 2 and an
Else If
that checks for a value of 3.