Add a Form with a Dependent Table
Last updated 10/05/2024
Dependent Tables
The Dependent Data Source field will only list tables that have a dependency established in the database. If there are no dependent tables, the dropdown will display No Options.
Inheritance allows child tables to inherit the common field attributes from a parent table creating a parent-child relationship. This causes the child table to inherit the fields and constraints from its parent along with its own defined fields.
When selecting a dependent table you will have access to the fields from both tables to use on your form.
Example
The following diagram shows the children tables inherit all the fields of their parent table, plus have additional fields unique to themselves. The parent table has a Type (EntityType) field to hold the type of child.
The MotorDealer, Contact, and Customer tables all inherit the field attributes from the Entity table along with their own defined fields.
Requirements to Set Up a Dependency
- The main data source must have a Type field of some description. The type indicator is a way to determine the type of entity. For this example, the Entity table has an EntityType field to indicate whether the entity represented by the table row is a motor dealer, contact, or customer.
- The Type (EntityType) field on the form requires a default value to be stored in the database for the parent table. For this example, C for Customer.
- The Show If field for the Type (EntityType) field will need to be set to falseto hide the field on the form.
Add a Form with a Dependent Table
1. Click the Add Item button, give your form a title, and select a data source.2. Select a dependent data source in the Dependent Data Source field.
3. Click the Pages tab.
4. Click the Add Pages button.
5. Give your page a caption and click the Fields tab.
6. Click the Add Fields button.
7. Select the Type field in the Field field.
8. Type
9. Select _Text in the Display Type field.
10. Type a value in the Default Value field.
11. Click the Display tab.
12. Click the Cancel button in the Show If field and type
13. Click the Save button in the form app bar and continue to add all the fields your form needs by clicking the Add Fields button each time.
14. On completion click the Save buttons in the form app bars.