Setting up snapshots of lookup fields

Generally, in a parent-childrelationship, the lookup field in a child record effectively imports the current value of a field in the parent record. If the value of the field in the parent record changes, then the value in the lookup field changes as well. There are times; however, when it would be useful to freeze the value in a lookup field. Quick Base does this using snapshots.

For example, in an Order Entry application with a Products table and an Order Details table, there might be a lookup field in the Order Details table that looks up the price of an item in the Products table. When someone places an order, they order the product at its current price and that's what they expect to pay. The price should never change in the Order Details table if the price changes at a later date in the Products table.

You can capture the value in a specific lookup field used in a parent-child relationship and freeze it by setting the Snapshots field property for the field that will hold the frozen values. Once you have captured the value of a specific lookup field, the value in this field (in the details table) will not change when changes are made to the contents of the parent record. The only time the value of a field set to be a snapshot can change is if the child record is changed so that it refers to another parent record. Then the snapshot field would take on the value of the lookup field in the new parent record, and afterwards it will be frozen as described above.

When you initially set up a snapshot field for an existing application, you may want to update all the existing records with a snapshot of the current value. You can do this by selecting the Snapshot checkbox in the Advanced section of the field properties. If you select this option and the field you designate as a snapshot field contains existing values, those values will be overwritten with the current value in the parent record.

When setting up snapshot fields, the following rules apply:

  • You can set the Snapshots field property for these field types: Text, Numeric, Date, Date/Time, Time of Day, Duration, Checkbox, Phone Number, Email Address, User, List - User, and URL.

  • You can only take a snapshot of a lookup field.

  • Snapshot fields cannot have a required value.

  • Snapshot fields cannot be set to have unique values.

To set up a snapshot field:
  1. Open the application for which you want to set up a snapshot field. (This is only useful in apps with multiple tables.)

  2. If a relationship doesn't already exist, create a relationship between the table that contains the field that you want to look up (the Products table in the example above) and the table in which you want to display it (the Order Details table in the example above).

  3. Add a new field in the details table (the Order Details table in the example above) to hold the snapshot value of the lookup field (using the example above, create a field named "Order Price" to hold the snapshot value of a lookup field named "Price").

  4. Click the field name to open the Field Properties page for the field that you just created, and scroll to the Advanced section of the page.

  5. Select the Snapshot checkbox, labeled Get this field's value from a lookup field and don't allow the value to change.

  6. From the Lookup field dropdown, select the lookup field whose value you want to capture.

  7. To update all the existing records in your application with a snapshot of the current value (or the current price, in this case), select Initialize field for existing records, click Save, and then click OK to confirm that you want to overwrite the existing values in this field with the current values in the parent record.

    Note: This option is only available at the time you set up the snapshot field.


Go back      |       

© 1999-2019  QuickBase, Inc.  All rights reserved.  Legal Notices.