Control - Query Records
When viewing a record, sometimes you also need to quickly view the data recorded in other worksheets, which may not be associated with the current record, as long as they meet the query conditions,they can be attached to current record and displayed in this record for quick browsing.
Scenario
In Customer Management application, the Order worksheet is associated with the Customer worksheet, therefore in the Customer worksheet, you can view the orders associated with the current customer by the Query Records control.
In the Warehouse Management application, in the Product worksheet you can view the inbound and outbound history of the current product by querying the product number.
Configuration
Case Background: As shown in the figure below, in the Customer Management application, the Orders worksheet is associated with the Customer worksheet. In the Customer worksheet, you can view the orders associated with the current customer through the Query Records control (one-way association, the Customer worksheet is not associated with the Order worksheet).
Add the Query Records control
In the Customer worksheet, add a Query Records control.
Configure query methods and conditions
There are two ways to configure query conditions, new query and existing association.
New query: you need to configure the filtering criteria from scratch.
Existing association: You can quickly set up some criteria by selecting existing associations, and then you can continue to complete it.
New query
For example, if you need to query the approved orders of the current customer, you can first configure the conditions by creating a new query, then select the associated worksheet to be queried, and then click [Next].
Configure the conditions:
Condition 1: The associated customer field in the Order worksheet is associated with the current record.
Condition 2: Status is approved.
Finally, click [Confirm] to complete the configuration.
Note: Since the Order worksheet is already associated with the Customer worksheet, then when you select the Order worksheet, the system can monitor the association and prompt you whether to use the existing association to configure the query conditions.
After selecting, click [Next] and the system will automatically create an associated filtering condition. You can continue to add conditions as required.
Existing association
You can also quickly create query conditions with existing associations. Select the exisiting association in current worksheet and click [Next].
A query condition will be added automatically (the associated field customer is the current record), and you can continue to add other conditions.
More Settings
After configuring the query conditions, you can set more features for better performance.
Display Mode
As for how the queried records will be displayed in current record, there are 3 modes:
Text (default way, display up to 50)
Card,
List
The following is a demonstration of the three modes.
Order
The queried records are displayed according to the order set here.
Allow to add new record
If checked, a New Record button will be displayed.
Allow to open record
If checked, you can click to view the record details and can select a view to display the records based on the view's settings.
Filter by user permissions
If not checked, all eligible records are displayed; if checked, only records that the current user has permission to view are displayed.
About Query Records
Query records are only used for displaying not storing data.
Filtering and sorting are not supported.
It cannot be used as condition or dynamic value.
It can be set to show, hidden, read-only in business rules and workflows.
If the display mode is list, you can also set the columns to show or hide.
Difference between Query Records, Relationship and Bidirectional Association
Query Records control is a real-time query based on conditions and presents results without saving data.
Relationship control usually selects records in the target worksheet for the need and saves the association.
Bidirectional association usually requires to add an associated record in both worksheets and synchronize data in both directions.
For example, in Sales Management application, if you need to select the customer when creating an order, then you should add the relationship.
When viewing customer records, if you need to query the orders associated with the current customer, you should add query records.
When managing sales staff and teams, you need both sales staff to associate with teams and teams to associate with sales staff. In this case, you can choose bi-directional association, and automatically synchronize the results from both sides.
In addition, when the amount of data on the side of an existing bi-directional association is too large, it can also be changed to add associated records from one side only, and use query records on the other side to get the results, to reduce the burden of synchronizing data in both directions and thus optimize worksheet performance.
Have questions about this article? Send us feedback