
You create queries in the application using the query editor of the Mobile Applications for Laptop plug-in. In the query editor, you define the input and output classes, aliases, and conditions for the query.
According to the logic of the tutorial application, the user selects a particular customer in the first view, and chooses the Show Orders push button. Then the second view that contains the service orders of the selected customer appears. For realizing this particular logic, you have to define queries.
In the application, the query parameter used for comparison is the Customer ID since this is common for both: customer details and service orders. In the application, you must define two classes: composite class and query class. The composite class obtains the value for the Customer ID. The query class compares the value of Customer ID in the two data objects (customer details and service orders), and stores the result of the comparison.
In the Laptop UI explorer, expand the development component storage.
Expand ServiceModels. Click Model Classes with the secondary mouse button and choose Create Query / Composite Model Class .
Enter QueryComp as the query name, and choose Finish .
In the Properties tab, choose Add .
In the attributes list, select .
Choose Next and then choose Finish .
In the Laptop UI explorer, click Model Classes with the secondary mouse button and choose Create Query / Composite Model Class .
Enter ServiceQuery as the query name, and choose Finish .
Choose the Query tab, and enter the following details:
|
Field name |
Value |
|
Input Model Class |
QueryComp |
|
Result Model Class |
SERVICEORDERS _ SOHEADERS |
|
Conditions |
SERVICEORDERS _ SOHEADERS.CUSTID LIKE: CUSTOMERID |
Choose Save.