Recital

Login Register

Recital Data Validation: dynamic list of choices

Each Recital table can have one or more data dictionaries to provide a central repository for constraints and other metadata. 

Here's how to set up field validation based on dynamic values from another table.

Using the products.dbf table from the southwind sample database, validation can be added to the categoryid field to ensure it matches an existing categoryid from the categories.dbf table.
open database southwind
alter table products add constraint;
(categoryid set check rlookup(products.categoryid,categories))
The rlookup() function checks whether an expression exists in the index (master or specified) of the specified table .  An attempt to update categoryid with a value not in the list will give an error: Validation on field 'CATEGORYID' failed.

If you have access to the Recital Workbench, you can use the modify structure worksurface to add and alter your dictionary entries, including a customized error message if required.

validation


Twitter

Copyright © 2024 Recital Software Inc.

Login

Register

User Registration
or Cancel