Database Reference
In-Depth Information
POWER USERS' CLINIC: A CALCULATION IN A BUTTON
On Creating a Button , you learned how to create buttons on a layout and program them to perform
all kinds of database duties at a click. The only problem is, the more features you give your data-
base, the more buttons you have to make. And some of the folks using your database need a com-
pletely different assortment of buttons. Fortunately, most button commands have one or more op-
tions you can set with a calculation. The calculation can adjust what the button does based on field
data, user information, the current date or time, and so forth.
Suppose you have two different layouts to view the people in your People database. One is for the
people who are customers , and the other is for employees . You might think that with two different
detail layouts you'd need two buttons. But you can summon the power of calculations to make one
button do double duty.
If you take a peek at the options for the “Go to Layout” button action, then you see that in addition
to all the layouts in your database, the pop-up menu includes two options you haven't used before:
“Layout Name by calculation” and “Layout Number by calculation.”
If you pick either of these options, FileMaker presents the Specify Calculation window. You simply
write a calculation that evaluates to the correct layout name (or number if that's your persuasion),
and FileMaker goes to the right one. For example:
If ( Person::Type = "Customer", "Customer
Detail", "Employee Detail" )
Character Functions
Parsing by character comes in handy when you have data in a predictable format and you
need to access pieces of it. You can use functions to grab the first three digits of a Social Se-
curity number, the last four digits of a credit card number, or the style code buried inside a
product number.
FileMaker can work with individual characters inside a text value. The first letter in a text
value is number 1, the second is number 2, and so on. Then you can ask for the first few
characters, or the last few, or just the fifth, sixth, and seventh.
NOTE
Every letter, number, punctuation mark, space, tab, carriage return, or other symbol counts as a char-
acter.
Search WWH ::




Custom Search