Single-Record Linkage of Subform
Introduction
Case Introduction
This case will introduce how to retrieve a certain record from a subform in another form to the current form with Data Linkage.
Application Scenario(s)
- In the case of sales management, you can record the order details in a subform and set a single-record linkage to adjust product inventory in another form.
- In the case of task management, to let the members take their respective tasks from the main form, you can set a single-record linkage to assign different tasks for the members with the subform.
- In the case of product management, you can register the product details in a subform and set a single-record linkage for the subform, then you can call the product details in the main form.
How to Design
1. Add Number fields as auxiliary fields in the two forms.
2. Use the subform as the data source of an aggregate table, and set the auxiliary fields as measures to differentiate subform records.
3. Set a single-record linkage for the subform in the form and use the auxiliary fields to set conditions and call the value from the aggregate table.
Preview
For example, in product model registration and stock-in registration:
1. Record the product model details in the Product Model Registration form.
2. When filling in the stock-in information in the Stock-in Registration form, the product model details will be displayed according to the product you selected.
Setting Procedure
Take an example of product model registration and stock-in registration.
Designing Forms
1. Create a Product Model Registration form and add the following fields:
Field Name | Field Type | Field Setting |
Registered at | Date&Time | Select Current Time for Initial Value. |
Registered by | Member | Select Current User for Initial Value. |
Product Model Details | SubForm | / |
Product Name | Subfield > Single Select | Select Custom for Option and customize the product names. |
Quality Level | Subfield > Single Line | / |
Number – Auxiliary Field | Subfield > Number | Set Initial Value to 0. |
2. Create a Stock-in Registration form and add the following fields:
Field Name | Field Type | Field Setting |
Registered at | Date&Time | Select Current Time for Initial Value. |
Registered by | Member | Select Current User for Initial Value. |
Number – Auxiliary Field | Number | Set Initial Value to 0. |
Product Name | Single Select | / |
Quality Level | Single Select | / |
Quantity | Number | / |
Creating an Aggregate Table
1. Go to App Management > Aggregate Tables, and click New Aggregate Table.
2. Name the aggregate table as Single-Record Linkage, click Data Source > Single Form, select Product Model Registration from the drop-down list, and click OK to save the settings.
3. For the Row Header of the aggregate table, add the Product Name and Quality Level subfields from the Product Model Registration form.
4. For the Measure of the aggregate table, set the Auxiliary Field to Number – Auxiliary Field. The Number – Auxiliary Field is from the Product Model Registration form.
After the settings, click Save.
Setting Data Linkage
1. Select the Product Name field of the Stock-in Registration form, go to Field Properties > Option, then select Data Linkage.
2. Click Data Linkage Settings and make the following settings:
- Linked Form: select the Single-Record Linkage form from the drop-down list.
- Condition Settings: select the Auxiliary Field field of the linked form and the Number – Auxiliary Field field of the current form, then set the relationship as equals.
- Triggered Linkage: display the value of the Product Model Registration.Product Name field in the Product Name field.
After the settings, click OK.
3. Similarly, set the data linkage for the Quality Level field:
- Linked Form: select the Single-Record Linkage table from the drop-down list.
- Condition Settings:
Select the Auxiliary Field field of the linked form and the Number – Auxiliary Field field of the current form, then set the relationship as equals.
Select the Product Model Registration.Product Name field of the linked form and the Product Name field of the current form, then set the relationship as equals.
- Trigger Linkage: display the value of the Product Model Registration.Quality Level field in the Quality Level field.
After the settings, click OK.
Setting Field Permissions
For the Number – Auxiliary Fields in the Stock-in Registration form and the Product Model Registration form, go to Field Properties > Field Permissions, and disable the View permission.