Create Requests
The requestor is a function that is used to create the inquiry screens that are used to display the results of the requests carried out on the database. It operates by temporary extraction of the data in a table, then by running an inquiry on this table. The inquiry can then be made at several levels of detail, defined by successive page breaks.
The structure of this temporary table enables each user to keep the results of the last query run on the database (unless it is a shared query). Using this functionality implies three different phases:
- definition of the query by this function,
- launch of the query (either using theor using the inquiry function and then the data refresh request).
- inquiry of the query if it has already been executed.
The definition of the requests is made by giving a list of fields arising from the database tables, of expressions that can used with the database fields, the constants and the expressions. The joins between tables are automatically determined from the dictionary, but it is possible to explicitly define them thanks to the Advanced tab.
Let us underline the existence of two additional tools: An equivalent query tool to the present one, but based on a visual editor, and an SQL query tool going through identical inquiry screens but whose purpose is to design queries based on the SQL language.
Prerequisite
Refer to documentation Implementation
Screen management
The definition of a query is performed on several tabs but only the first one is mandatory.
Header
The header provides information to identify the query and some setups of a general nature.
Block number 1
Code (field COD) |
This code is used to identify a request. |
Description (field INTIT) |
Use this field to assign a description to each record. |
Short description (field INTITSHO) |
This title, which describes the record, is used in some screens or records when there is not enough space to display the long title. |
Characteristics
Active (field ENAFLG) |
Select this check box to activate the current record. Disabled records keep their content and setup but cannot be used by recalling their code:
The authorizations for a given function can prohibit the creation of an active record. In this case, the check box is disabled by default. It can only be modified by an authorized user or through a signature workflow. |
field WW |
Representation (field REPGRA) |
This indicator defines the fashion in which the representation of the data will be made in the screen. The possibilities offered are as follows :
|
field OPTGRA |
Used to organize the relationship between the character and the graphic, when the presentation mode for the data allows both. According to the case :
|
Tab Fields
This tab makes it possible to define the information to print in the form of a grid defining the database table where the information comes from, the fields or expressions to extract and the total and break criteria.
Using all the information defined in this grid, the query designer specifies a query on tables linked by join conditions defined by default. Thus, in simple cases, it is not necessary to complete the next tabs.
Grid
Table (field TBL) |
This is the name of the table from which the information will be extracted. An entry is mandatory even if you plan to display an expression combining several fields related to different tables, or to no table at all. In this case, just enter the code of any one of the tables used in the inquiry. (This implies that the first line of a User-defined Inquiry cannot be such an expression.) |
Field (field FLD) |
This is the code of the Field that contains the data that will be displayed in the inquiry. Your selection is conditioned by the specific table that you chose in the previous field. |
Description (field INTITLIG) |
Used to define the title of the column as it will be displayed on the execution of the request. By default, when a field in a table is used, its title (as it is stored in the dictionary) is proposed. In a multilingual context, this title is displayed during the execution in the connection language of the user, the dictionary texts being managed in all the connection languages. This assumes that it is possible to define the translations for a modified title or corresponding to an expression calculated for which no translation has been defined. In translatable fields such as this one, you can enter a description in a language other than the connection language: Click On line translations from the Actions menu. |
Expression (field CLC) |
This is the Expression, composed in the Adonix Language, with the help of the Formula Editor if required, that must be entered if no Field name was assigned on the inquiry line. The expression can integrate fields from any of the available tables, plus constants, operators, functions, and other variables that are needed. |
Type (field CODTYP) |
This data type is used to specify how the data will be presented.. In the case of a field, the type associated with the field is proposed by default (but can be modified). In the case of an expression, it must be specified (it can be a generic type such as a string of characters A, a local menu M, a short integer C, a date D, a decimal DCB, a long integer L...). In the case of a string of characters, its maximum length will be specified in the Length field that follows ; in the case of a local menu, both the length of the display and the local menu number to be used are specified. If the data type used is linked to an object, it will be possible to use a tunnel to the object management during the enquiry. |
Length (field LNG) |
Used to define the length of a field when this field uses a generic data type where the length is not fixed. This is notably the case for the types A and DCB. |
Menu (field NOLIB) |
Defines the local menu number associated with the field defined on the line. When a field is of the type local menu (from 1 to 255) corresponding to the rank of a title in a table named local menu, stored in the messages table APLSTD. On entry or on display, the following are displayed according to the choices made in the user interface :
The interest of this type of entry is that the list of choices is displayed in the user connection language. Each local menu number characterises the list of available titles. For example, the local menu 1 corresponds to the choice No / Yes in this order. In this particular case, the user interface can also be a check box. |
Range (field STREND) |
When you execute a User-defined Inquiry, you may often want to change the data selection criteria, so that you end up seeing exactly what you want, and not all of the data. To do this, simply enter "Yes" for those critical fields. |
Total (field CUM) |
This field can be assigned only if the line contains a numerical data element. If set to "Yes", it allows you to roll up totals to higher "Groups" in the inquiry display (i.e., at higher break levels). |
Sort (field SRT) |
This field allows you to sort the data elements that will be displayed in the inquiry - in the order in which they appear on the lines in this table. Sorting may be either done Ascending or Descending. |
Group (field GRP) |
This field is used to create a break level. If this field has the valueYes, a group of fields that follow can be made by break in the current field and potentially any totaled values will be displayed at the group level. This field can only be entered if a sort has been defined on the current line (Ascending or Descending according to choice). For example, if a list of users is defined by profile, a break by profile can be used to group on a single line all the users linked to a profile and to display totaled data linked to the group (for example their number of there is a field equal to 1 that is accumulated). |
Level (field NIV) |
Corresponds to the level of detail desired for the display of the information. Level 1 signifies that the information is displayed at level one of the aggregation (the highest) and all the successive levels, level 2 signifies that the information will not be displayed at level 1 but at level 2 and all the more detailed levels etc. The highest level therefore corresponds to the most detail level of the inquiry, that which is displayed by default when launching the inquiry. This level is assigned by default to 1 on the first line and incremented each time a break is requested (Group=yes) for the previous field. It can be modified in order to display an amount at a different aggregation level. For example, when sorting and grouping the information by a code such as the user code and the user name is required in the next column, it is clear that this name must be displayed at the same level as the user code and not only at the more detailed levels. |
Tunnel (field TUN) |
Graph type (field GRA) |
This field can only be entered if the representation mode selected in the header is not Character. It is used to specify the fashion in which the graphical representation will be used. It can take the following values:
|
Representation (field REP) |
This field can only be entered :
It is used to manage the graph combinations if the graphic type defined in the graphical parameters is used to make several series appear, independently of different types (it is ignored in other cases). In practice, the usable combinations are as follows :
The rule is as follows :
|
First default (field VALDEB) |
Here is entered the setup value in the form of a calculated expression involving variables linked to the launch context. If the setup is a start-end range, two values must be entered. |
Last default (field VALFIN) |
Tab Advanced
Entering this tab is not mandatory. It is used to specify:
- criteria related to the data presentation (page numbering, report used, etc.).
- additional selection criteria.
- specific join conditions.
The join conditions are useful in the two following cases:
- if the automatic join algorithm does not work. This case is easy to recognize since an error message is displayed upon query validation. Sometimes it is sufficient to add a link to one of the tables whose links are not described in the dictionary to solve this case (the definition of the other links remains automatic).
- if the join algorithm links tables in a way that differs from what was expected. As a matter of fact, in complex cases, several links may exist between tables. However, the algorithm stops when the first links is found. In order to verify if the join is in conformity with what was expected, it is possible to use the button Infos / Links, which gives the details of found links.
Block number 1
Number of lines (field NBRLIG) |
Specify the maximum number of lines returned by the query. The default value is 0. The maximum number is 100. |
Maximum lines (field MAXLIG) |
The maximum number of lines corresponds to a query parameter (maxrows) that stops the search once the number of lines meets the conditions that have been found in the database (these lines will then be sorted, but the database does not guarantee that the N lines found are the first N in the sort order). This represents an optimization used to limit the database load. |
No. of fixed columns (field NBRCOL) |
Makes it possible to fix the first x columns of a grid in the case of horizontal paging. |
Maximum times (field MAXTIM) |
Allows the stopping of the search after this period of time. (expressed in seconds) This makes it possible to avoid waiting too long a time, namely in the case where a new query is being set up. Note: Contrary to the maximum number of lines, this information is not transmitted to the data base. The maximum time can be exceeded if the duration of the inquiry is too long. |
Report (field RPT) |
It defines the code of a report that will be associated with the File / List function from the query inquiry. If this is not entered, the report ALISTE is used, which will submit a default page format. It is possible to duplicate this generic report (in principle it will then only be necessary to modify the page format) to create reports perfectly defined for the query thus defined. The report code entered here can be associated with a set of print codes via the dedicated function. |
Grid Selections
Selection criteria (field SEL) |
Used to enter selection criteria, which are logical expressions applied to table fields, and that can include constants, functions and operators. Only the lines in the table that meet these conditions will be extracted. The formula editor is used to simplify the writing of such expressions. |
Grid Links
Link expression (field LNK) |
It is necessary to define here the links that have not been defined in the dictionay or which have to be used in priority. The link structure must correspond to the key of the file to be linked. It must have as many fields separated by semi-colons as key parts. In effect, the exact syntax is the following: [F:ABV1]CLE=expression1 ; expression2..., where: [F:ABV1]CLE is the key of the linked table. Using the right click provides access to the Choose a table function, which submits the list of all the tables presented in the first tab. Selecting a table leads to the display of the first index in the table. If another index is required, the function Choose an index is also accessible via right click, which will make it possible to choose from amongst the list of all the indices for the table previously selected. expression1, expression2 represent the expressions used to give values to the various fields of the previously defined key (if the key has only one part, there is only one expression, otherwise, the expressions are separated by a semi-colon). There is also the Choose a field function, used to enter the various values of the key with fields of one of the tables concerned. After the choice of the key, which displays the number of semi-colons defining the sections of the key to be entered, this function is used to successively fill all the missing sections. It should be underlined that constant key parts can be defined. From the database perspective, this syntax defines left outer joins. It should be noted that a second syntax enables strict joins to be created (which can be interesting from a performance point of view). A tilde (~) is then added to the syntax which becomes: [F:ABV1]CLE=expression1 ; expression2... |
Tab Access
This tab is used to define the access conditions to the query and the extracted data.
Query type (field ALLUSR) |
Used to manage the display of a query in inquiry mode, with the following behaviors:
|
Group (field GRP) |
Used to make a classification criterion available for requests. |
Access code (field ACS) |
This access code makes it possible to prohibit access to the current record for some users. If the field is populated, only users that have this access code with read access rights (and write access rights respectively) can view (or with write access rights, modify) the record. The execution right controls who can execute the query in question (by refreshing the query or by modifying the parameters and then re-running it). |
Object (field OBJLNK) |
Used to determine the authorization filters applied to the forming of the query. These filters are the filters by site, by role and by access code. The filtering principles are the following:
This of course supposes that the table on which the filters are carried out is part of the generated query. What is meant here is the table containing the access code and site code fields, and, when necessary, the field defined by the roles assigned to the user. This is not necessarily the main table in the query: for instance, a query on document lines can be filtered with respect to authorizations given for the fields of tables linked to the document header. Warning, these filters are only applied during the running of the query and not during inquiry. This is important if the query is shared, for instance, or if the filters by site for a user have changed between the time when the query has been calculated and the time when it is viewed. |
Function (field FCTLNK) |
Used to link the authorizations to access the query with those authorizations granted on the function. The principle is as follows: upon entering the query, it is checked that the linked fucntion is authorized to the user (for at least one site, if the authorization on said function is granted by site). This is checked only in the case when this query is not shared. In effect, if the query is shared, it is admitted that the authorizations of the person that run the query are applied and shared with all those that have the right to view it. It is therefore necessary to be very careful when defining the authorizations of the shared queries if they concern sensitive data. This is done using the access code located in this tab. |
Tab Graphic
This tab can only be entered if a graphical representation is available for the query. The way the data are displayed on the graphic is then defined.
Graph
Type (field TYPGRA) |
This field is used once there is more than one numeric value in the grid that is likely to be presented in a graphical form. It can take one of two values :
|
Representation (field FSHGRA) |
When several series are presented in the graph (provided that the presentation of all the series is identical and is not by sector type), it is possible to specify how the series values are combined in the display, by entering the following value :
|
Default graph (field DEFGRA) |
Defines the graphical representation used for the data to be presented (from the choices Bars, Lines, Area, Sectors). An image is displayed as a function of the choice made illustrating the type of presentation obtained. If only one series of values is available, the graphical representation is by default fixed by this parameter. If several series of values are presented, it is possible to mix the presentation modes (one series in the form of bars, another in the form of lines for example). In this case, each series of values is represented as a function of the field Representation located in the grid of fields :
When used, if the representation of the series is homogenous (that is there is only one series in the graph), there is a graph type selector for the user to select a different mode of presentation. |
Block number 3
field IMAG |
Image explaining the information previously entered. |
Block number 2