Database Reference
In-Depth Information
FREQUENTLY ASKED QUESTION: VALIDATE ONLY IF FIELD HAS BEEN
MODIFIED
What's the “Validate only if field has been modified” checkbox for? I don't remember seeing this in
the Specify Calculation window before. For that matter, where did the Result Type pop-up menu go?
Good eye. The Specify Calculation window can show up in lots of places—when defining a calcula-
tion field, when specifying an auto-enter calculation, and so on—and it can change slightly in some
cases.
First, the Result Type pop-up menu shows up only when you're defining a calculation field, since it
can produce any data type. Since a validation calculation always has a Boolean result, there's no
need to ask you here.
In place of this pop-up menu, you often see some new option specific to the calculation type—like
the “Validate only if field has been modified” checkbox in Figure 9-10 .
Normally when you edit a record, FileMaker validates only the fields you actually change. Any field
in the record that hasn't been changed is accepted even if it violates the validation rule. This viola-
tion can happen when you have your field set to validate “Only during data entry” and the records
have been set some other way—from an import ( Importing Data ) or with a set field in a script ( Pre-
paring the Database ) . If you want to validate this field whenever you edit the record, not just when
the field itself changes, then turn off this checkbox.
Commenting in Calculations
Everything you can put in a calculation has some kind of value—unless it's a comment .
Comments are brief notes that you place inside a calculation. Professional database deve-
lopers, like all good programmers, provide lots of comments for the benefit of people who
might work on the computer code months or years later. Once you have a few sets of paren-
theses or nested function calls, you may have trouble understanding even your own
FileMaker calculation when you have to go back and make changes. When it evaluates the
calculation, FileMaker ignores all comments completely—it's as if they weren't there. (But
you'll be glad they are.)
NOTE
You may have noticed that this topic shows some extra spaces and paragraph returns that FileMaker
doesn't throw into your functions automatically. These spaces are for ease of reading, and lots of de-
velopers type them into their calculations. Like comments, FileMaker ignores those extra spaces and
blank lines, as long as all the other syntax is correct.
Search WWH ::




Custom Search