Database Reference
In-Depth Information
Now return to your database and then try your script out: Find a customer without an email
address (or just delete the email address for the Customer record you're viewing—this is just
a sample database, so it's OK), and choose Scripts→Send Email. If you look at a customer
record with an email address, then the script creates an email message in your mail program,
ready for you to fill out. If the email address field is empty, then you see an error message in-
stead. Finish up by creating a button for this script and then add it to the Customers layout
for the ultimate in convenience.
Testing Multiple Conditions
If you have more than one condition to consider, you can use the Else If script step. You
could have a script like this, for instance:
If [ Get ( CurrentTime ) < Time ( 12 ; 0; 0 ) ]
Show Custom Dialog [ "Good Morning!" ]
Else If [ Get ( CurrentTime ) < Time ( 18 ; 0 ; 0 ) ]
Show Custom Dialog [ "Good Afternoon!" ]
Else
Show Custom Dialog [ "Good Evening!" ]
End If
When this script runs, it tests each condition in turn, deciding which custom dialog box to
show someone, based on the actual current time. If the current time is before noon, she sees a
“Good morning” message, and the script jumps to the end (the End If script step) without
needing to test the second condition.
Search WWH ::




Custom Search