Skip to main content

Dependent Field

Last updated 21/12/2021

Dependent Field Control Configuration

The Dependent Field field is a field which is populated by referencing the value of another field, known as an independent field on the current form. Each time the value in the independent field changes, Five automatically repopulates the value in the dependent field depending on the entry made in the independent field.

The Dependent Field field can rely on a field from a reference form. Updating the selection in the independent field will force Five to repopulate the values in the lookup list for the dependent field connected with the new entry.

Example

The Production application has an Order Parts form to order parts. We need at a minimum on the form the following fields:

  • VendorKey
  • CatalogKey

Requirements

  • The VendorKey field will need to have a display type of _Lookup and reference the Vendors form in the Reference Form field.
  • The CatalogKey field will need to have a display type of _Lookup, reference the Catalogs form in the Reference Form field, and use the VendorKey Field ID in the Dependent Field field.
info

To have the name of the vendor and the name of the catalog available in the lookup lists in their respective fields, the first field to be included in the list on both forms needs to be the Name field.


Prerequisites

  • The Vendors form must be saved in Five to reference the form in the Reference Form field on the Order Parts form.
  • The Catalog form must be saved in Five to reference the form in the Reference Form field on the Order Parts Form.
  • The VendorKey field on the Order Parts form needs to be added first to be available in the lookup list in the Dependent Field field for the CatalogKey field.

Steps

  1. Select Forms in the menu.
  2. Click the Add Item button in the list app bar.
  3. On the General page, add the required details for the form.
  4. Click the Pages tab.
Add a Form
Figure 1 - Add a form

  1. Click the Add Pages button.
Add Pages Button
Figure 2 - Add Pages button

  1. On the General page, add the required details for the page.
  2. Click the Fields tab.
Add a Page
Figure 3 - Add a page

tip

Keep the default of Form for the page type.


  1. Click the Add Fields button.
Add Fields Button
Figure 4 - Add Fields button

  1. Use the lookup icon in the Field field and select the required table field. For this example, the VendorKey field.
  2. Type a caption in the Caption field. For this example, Vendor.
  3. Use the lookup icon in the Display Type field and select _Lookup.
  4. Use the lookup icon in the Reference Form field and select the required form to reference. For this example, the Vendors form.
  5. Click the Save button in the form app bar.
Vendor Field
Figure 5 - VendorKey field

info

The lookup Display Types _Lookup, _LookupCustom, _LookupQuery, and _LookupUnique can be used when configuring a dependent field. The display types of _LookupCustom and _LookupQuery do not require a form to reference.


  1. Click the Add Fields button.
Add Fields Button
Figure 6 - Add Fields button

  1. Use the lookup icon in the Field field and select the required table field. For this example, the CatalogKey field.
  2. Type a caption in the Caption field. For this example, Catalogs.
  3. Click the Include In List switch to a true state.
  4. Use the lookup icon in the Display Type field and select _Lookup.
  5. Use the lookup icon in the Reference Form field and select the required form to reference. For this example, the Catalogs form.
  6. Use the lookup icon in the Dependent Field field and select the required field on the current form that will change if the value in the VendorKey field changes.
  7. Click the Save button in the form app bar.
CatalogKey field
Figure 7 - CatalogKey field

  1. Click the Add Fields button.
  2. Continue to add the necessary form fields to the table.
  3. On completion of the final form field, click all three Save buttons in the stacked form app bars.
Save the Form
Figure 8 - Save the form

info

A field on a form can be edited at a later date to configure a dependent field.


How This Will Look in Your End-User Application

After selecting a value in the independent field (Vendor field), the dependent field (Catalog field) will only display in the lookup list the criteria that meets the selection in the independent field.

For example, selecting the vendor All things car will only make the catalogs that belong to this vendor available in the lookup list.

Changing the entry in the independent field will cause the values the dependent field to change.

Changing the Independent Field Will Make the Dependent Field Update
Figure 9 - Changing the independent field will make the dependent field update