The Dynamic Query Mask

For complex queries on meta- and user data DataView provides a dynamic query mask. Starting from the main entity you can compile individual query lists and search data for instance across several linked entities in the data model.

This is how to compile an individual query list:

  1. Use the new toolbar button to open the dynamic query mask.

  2. Locate the title of the main entity in the head of form.

    It is a precondition for the query that a title has already been assigned to the entity.

    The main entity for one or several query lists is the entity that represents the starting point of the query in the data model, or its master table that is to provide the data to be found, respectively.

    After Get the default master list for the main entity it will appear in the first folder. It is used as a template and cannot be modified.

  3. Select New in the context menu of the header form and enter the name for a new query list into the input mask (any name).

    A new folder will be opened which first displays the copy of the default master list as the new query list.

  4. Remove any not required fields/columns from the query list by pressing [Ctrl+Shift] and simultaneously selecting a column with the mouse and dragging it, with the mouse button pressed, to the desktop. Significant fields of the main entity cannot be removed.

    Insert new fields/columns into the query list by using the same procedure to select and drag fields/columns from any source mask to the desired position in the query list. Source mask is can be the DataView system forms (if you search meta data) or any user mask (if you search user data).

    Observe the rules for the layout of query lists.

  5. Now use the standard function Query as usual to search for the data.


Further Processing of Query Results

Query results in query lists can optionally be inserted via drag&drop into masks pointing to the master table of the main entity. This allows you to completely see and edit the records found. If the target mask already contain data, they will be deleted during drag&drop.


Saving Query Lists

Created canary lists for a main entity are not saved in the repository but in a user-specific file in the server directory <frm>. After closing and reopening the query mask and loading the main entity, all the query lists you already created for this main entity will be available again.


Rules for the Layout of Query Lists

The structure of the Where condition for the Select statement, which is issued during a query by DataView, is determined by the selection of the main entity, the selection of fields/columns in a query list as well as by their sequence. Thus, please observe the following rules for the layout of query lists.

Selection of the main entity
When you create the query list, you should always select the entity as the main entity whose master table contains the unknown data to be determined.

Selection of query fields/columns
As the first field you should always select a significant field of the main entity.

If the query includes several linked entities in the data model, the query list must contain at least one significant field of the entities included.

The sequence of significant fields in the query list must correspond to the sequence in which the included entities are linked in the data model.

If two entities are connected via a link in the data model, you do not have to add the corresponding key field. DataView will recognise it automatically. However, if the data model contains several links starting from one entity, you will have to decide which link the query is to include and then select the corresponding key field. If you do not do that, DataView will execute the query using the first link starting from the entity as defined in the data model.


Application-specific Structure of the Query Mask

The call of the query mask from within the application is done with the help of iwf_frm_ent ENTITY USRMGN_FORM.


Example for Query Mask

Let us assume you already created masks with context menus during application development. Now you want to find all masks whose Select menu contains an Edit item. The query in the data model of DataView includes the system entities T_MASK (mask data), T_MENU (menu data) and T_SELECTION (selection data). You select Mask Data as main entity, because the corresponding master table is to provide the unknown data. First you insert the required significant fields of the included entities (in the sequence defined by the data model) into the new query list. Additionally, the key field Menu/Sel must be inserted after Mask Name to make sure that the query includes the link mask-select-menu and not one of the other six possible links between masks and menu/button areas. Including the attribute field Selection Text is optional and is used here to enter the query term Update. If you also want to see the titles of the masks found, you can additionally incorporate the attribute field Mask Title between Mask Name and Menu/Sel.