• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

About Validation

Validation (sometimes called data integrity checking) refers to the rules about the data that are enforced primarily during data entry. There are five broad types of validation rules that you can apply to data:

  • You can specify validation rules that help to define the database table. For example, a field can be required (not empty), or its value can be unique. It can also be required to be a value that already exists in another record in the table. In each of these cases, you don't care what the value is, but you do care that the value adheres to rules such as these. (The unique value is often referred to in SQL as a primary key.)

  • You can specify the format in which data is entered. For example, you can require four-digit years for dates, or you can require four decimal places to be entered (even if they are zero, as in 42.0000). You can also limit the total number of characters in a field. As with the preceding set of validation rules, you don't care about the specific values entered, only their format and characteristics. (As you saw in Hour 4, “Introducing Layouts,” you can also apply formats automatically to data.)

  • You may want to create a validation rule that requires the data entered in a field to match certain predefined values. (For example, you can limit the values in a Category field to Agriculture, Aquaculture, Horticulture, and Dairy.)

  • You can require that a value pass a calculation test. For example, the ISBN (International Standard Book Number) for this book is 0-672-32578-0. The final digit is a checkdigit, calculable from the other nine digits. If you enter 1-672-32578-0, the calculation of the checkdigit will fail, and the incorrectly entered data can be rejected. FileMaker calculations allow you to check values against related tables, and they can be complex. When checking against related tables, you can implement relational integrity, which is integrity that checks against related fields in other tables so that your validation and integrity extend beyond the specific field and table that you're editing.

  • A special subset of calculation tests check for the quality of the data. Calculations of this sort typically test that a data value is within a certain range of the value for a previous record (last week, for example). If sales for this week are more than 10% different from last week in either direction, you may want to notify the user, so that the data can be inspected for an extra or missing digit. These quality edits differ from the previous validation edits in that they are typically warnings or recommendations that frequently can be overridden by the user (perhaps with a notation about a snowstorm closing the business for several days).


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint