Develop > Tailoring > Links > Virtual joins > Example: Creating a virtual join > Build the virtual join into the form

Build the virtual join into the form

Applies to User Roles:

System Administrator

To build the virtual join into the form:

  1. Open the orders form (created in Create the orders form) in Forms Designer.
  2. Click Design.
  3. Select the Group tool and Frame tool to create a frame on the screen where you want the seller data to appear. Give it the caption/title Seller Data.
  4. Select the Label tool and create a label named Seller Code.
  5. Select the Comfill tool and create a fillable input field. This enables you to choose from a list of seller codes.
  6. In the Property box, do the following:
    1. Type code in the input value and 9 (fill) in the ButtonID field.
    2. Click Y to confirm the addition.
  7. Click OK to save changes to the form.

Subform placement

  1. Select the Subform tool.
  2. Position the cursor on the screen where you want to begin your virtual join, and then create a square where you want the virtually joined subform to appear.
  3. In the Property box for the subform, type code in the Input field.

    The input field value (code) is the same as the previous input field value, because a link needs to be established with the target file. The Virtual Join tool uses the link with the code key on the sales file to pull in the information requested by the sales1 form, namely values for the name and commission fields.

  4. Type sales1 in the Form field to indicate which form should appear in the subform area.
  5. Click Yes in the Virtual Join field of the Property box to activate the virtual join functions on the subform.
  6. Click OK to save changes to the orders form.

    Note: You cannot see the subform at this point. The subform data fields do not appear until you enter data through the Database Manager.

  7. From the orders form, click More or the More Actions icon and then select Create file.

    The Database Dictionary (dbdict) utility opens.

  8. Create an orders file in the database dictionary.
    1. Type orders as the filename, and then click OK.

      If the name is prepopulated with orders, click OK to confirm.

      This creates a valid "orders" file. The dbdict record for it is now displayed in the System Definition Utility. In the Fields and Keys tab, you can look at field definitions and keys. It contains one key on field "customer.name," which is type "unique."

    2. In the orders file, ensure there is a line for the code field at the bottom of the list. If there is not, in the Fields section click New Field, and then create a new character field called "code."

    3. Click Save to save your changes.
  9. Close the System Navigator to leave the System Navigator utility and return to Forms Designer.

Related concepts

Virtual joins
Understanding subforms
Forms Designer

Related tasks

Example: Creating a virtual join
Build the sales form
Create the sales file
Create the sales record list
Add data to the sales file
Create the sales1 subform
Create the orders form
Build the link
Use the virtual join
Verify that the sales1 form works

Related references

Subform control