A script-enabled browser is required for this page to function properly.

About Populating Items with Values from Other Tables

It is often necessary to create an item in a data block whose value is derived from a table other than the block's datasource. Such items are sometimes known as look-up fields, because the application needs to query, or "look up," a value for the item whenever a query is executed in the block, or whenever the current record changes.

For example, in the sample tables, the S_ORD (Orders) table includes a CUSTOMER_ID column, but does not include the customer name. In the relational Schema, Name is an attribute of a customer, not of an order, and the rules of normalization dictate that it should appear in the S_CUSTOMER table, rather than in the S_ORD table. The CUSTOMER_ID column is the join field for S_ORD and S_CUSTOMER.

When you create a data block based on the S_ORD table, however, you will probably want to display the name of the customer along with each order, rather than just the ID for that customer. To do so, create a control item in the Orders block, and populate it programmatically whenever the customer ID changes.


Post-Query Trigger

When-Validate-Item Trigger

Populating an item with values from another table