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

Data Block Wizard: Master-Detail Page

This page appears when your form already contains one or more completed data blocks. The wizard gives you the opportunity to establish a master-detail relationship between the block you are currently working on and one of those other blocks. (The wizard assumes the block you are currently working on is the detail block; and the already-created blocks are potential master blocks.)

The logical link between the data blocks can be a join condition (primary-key foreign-key relationship) or a REF pointer link.

If there is only one candidate for the master block and only one possible logical link, your master-detail creation is straightforward. If there are several candidate blocks, and/or multiple logical links, the wizard lists them, and you then choose the master block and the specific link that you want.

The wizard also gives you the choice of building the linking condition yourself or having the wizard create it for you.

To create a master-detail relation:

First, choose a setting for the Auto-Join Data Blocks checkbox. Checking the box means the wizard will build the linking condition for you. In most situations, this is the simplest and easiest approach.

With Auto-Join selected:

  1. On the Master-Detail page, click Create Relationship.
    (If you are not connected to a database, the wizard displays the Connect dialog. Sign on to the desired database.)

    When you click Create Relationship, the wizard queries the database and displays (in its Data Blocks dialog window) all the data blocks in your form that are potential master blocks. For each of these potential master blocks, the wizard also displays the block's associated foreign-key constraint name and/or the REFs pointing to it.

    If no potential master blocks exist, the wizard displays an error message:
    FRM-10757: No master data blocks are available.

  2. In the Data Blocks dialog window, select a master data block and the desired link, and click OK.
  3. The wizard automatically interprets the foreign-key relationship or REF link between the data blocks' tables, displays it in the Join Condition field, and displays the name of the master block in the Master Data Blocks field. (You can use the Detail Item and Master Item poplists to modify the auto-created join condition, although normally that is not necessary).

Without Auto-Join:

  1. On the Master-Detail page, click Create Relationship.
    (If you are not connected to a database, the wizard displays the Connect dialog. Sign on to the desired database.)
    When you click Create Relationship, the wizard queries the database and displays (in its Data Blocks dialog window) all the data blocks in your form that are potential master blocks. The wizard does not display any foreign key or REF pointer information.
  2. In the Data Blocks dialog, select a master data block, and click OK. The wizard displays the name of the master block in the Master Data Blocks field
  3. Use the Detail Item and Master Item poplists to build a join condition manually.

Results

Once you specify the master data block and the join condition or REF, the wizard does the following:

To delete a master-detail relation: