Database Reference
In-Depth Information
FREQUENTLY ASKED QUESTION: I WANT TO STORE MY FIELD
What if I want to search on a field that FileMaker won't let me store?
Just because you can't store a field doesn't mean you don't wish you could. For example, in your In-
voices layout, you probably do want to be able to search for invoices with a balance due. But since
that field uses related data, it's not storable.
The good news is, you don't have to store a field in order to search it; the search is just a little
slower. You don't notice the slowdown until you've amassed lots of invoice records. Sadly, there's
no easy way to speed it up.
One remedy is to change the way people work with your database. You have to make your Invoice
Detail layout read only —meaning people can't change data on the invoice directly (see Display
Data From ) . Instead, they use a special layout and a script to make invoice changes.
When they're finished, your script can calculate the balance due and update a number field on the
invoice appropriately. This way, the Balance Due field is a normal, nonrelated field, eligible for in-
dexing and quick searches.
Also, remember that FileMaker can't search a calculation field that refers to related data very
quickly, but it can search the related data itself with lightning speed. For example, to find an invoice
that has payments applied to it, don't search the Amount Paid field in the invoice. Instead, search for
invoices where Payments::Amount is greater than zero. That search turns up every invoice with a re-
lated payment record that's not negative. You get exactly what you want, and FileMaker can carry it
out using indexed fields.
Even if FileMaker can store a certain value, you may not always want it to. Here are some
reasons you might turn on that “Do not store” option:
▪ Stored fields automatically recalculate as needed when other fields change. But
FileMaker has no such automatic behavior for other kinds of information. For example,
when you use the Get(CurrentDate) function in a calculation, FileMaker doesn't recal-
culate it when the date changes. In general, when you use any of the Get() functions,
you usually want to make your field unstored to “get” the most up-to-date information.
▪ A stored field takes up space on disk, while an unstored field doesn't. FileMaker 13 files
can hold 8 TB of data, so space isn't a major consideration for most people. But if you're
into slim and trim files, then you can save space by making calculations unstored.
▪ Lots of stored calculation fields can really slow down record creation . That's usually not
a big deal, but if you often import data ( Chapter 21 ) or use a script to regularly create lots
of records, then you can speed things up by reducing the number of stored calculations.
Search WWH ::




Custom Search