Database Reference
In-Depth Information
You can use a calculation field just like any other field: Put it on a layout, use it in Find
mode, and even use it in
other
calculation fields. But as a calculation field, its value always
stays up to date automatically.
Instant re-computation is what makes calculations useful for so many tasks. For example,
you can use a calculation with the Records→Replace Field Contents command (see
Using
the Replace Command
). Instead of replacing the data in every record with the
same
value, a
calculation can produce a unique value for each record. In the Manage Database dialog box,
you can start using the “Auto-Enter Calculated value” and “Validated by Calculation” field
options, making those features much more powerful. Scripts, as you'll learn in
Chapter 11
,
use calculations in many of their script steps. Here are some other places you can use the
Specify Calculation dialog box:
▪
Auto-enter
field options let you put a calculated result in a field when someone creates a
record or edits data (
Container
).
▪
Field validation
uses calculations to make sure the data entered in a field conforms to
rules you set up (
Looked-Up Value
)
.
▪
Portal filtering
lets you show only some related records in a portal (
Portal Filtering
).
For example, you can filter a portal so it shows only invoices with the status “Unpaid,”
or another portal could show only completed jobs.
▪ The
Send Mail
command can create email addresses or concatenate the body of an email
▪
Chart titles
, labels, and even x- and y-axes can be calculated (
Basic Charting (Found Set
▪
Tooltips
can use calculations to determine the message that gets displayed (
Tooltips
). For
example, you can show a list of related data, like the number of items remaining in in-
ventory, or the total of all Invoices for a specific customer.
▪
Conditional formatting
lets you apply logic to objects on a layout to change the way
they look (
Conditional Formatting
). On an invoice layout, for example, you can display
the Total Due field in a bold red font
if
the invoice is more than 30 days overdue.
▪
Scripts
let you use calculations to change the way script steps work. You can test condi-
tions, create dynamic data, or even take different actions based on the results of calcula-
tions.
Chapter 11
introduces you to scripts.
▪ The
Data Viewer
lets you preview your calculations without making a fake field or
messing with an otherwise good calculation that needs a little tweaking. (You need
FileMaker Pro Advanced to use the Data Viewer; see
The Data Viewer
.
)