Supervisor Administration Requester
Full version 7 function | Application/Contract | Sage X3/ERP | Class | QUERY('code') | Representation | QUERY~code~n |
---|
The Sage X3 Supervisor includes three different tools to build requests:
The requests created by GESALH can be executed in the client. This document explains how to use this function.
When a request is created by GESALH, the results are stored in a dedicated folder of the application server as JSON format text files. These files are indexed in a way that allows direct access to a given line, and sequential access to the next lines.
The requester can compute and display the results of a request at the correct level of data aggregation:
Links "+Lev" and "-Lev" allow you to navigate from one level to another.
There are two display modes for the request:
A graphical representation of the current page can be displayed for both modes.
Note: You can also enter "99" to display the latest level but this is not recommended as it might not work properly with the Office client. Try to use the correct initial level instead, from 1 to N, where N is the number of breaks performed.
After having created a request using the GESALH function and once the request is validated, the Supervisor creates:
Exemple: To access the "MYREQUEST" request page, you have to create a menu item with the following parameters:
This link gives access to the request, including a graphical representation of the lines. If the level is not given in the representation, only the grid mode is displayed. In this example, the representation would be "QUERY~MYREQUEST".
Additional parameters can be sent using the URL with the ¶meter=value
syntax.
Once this is done, clicking the link associated with the menu item gives access to the request display and the execution function.
When entering the request page, the Supervisor first determines if the request has to be recomputed. This can happen if at least one of the following conditions is met:
&forcedExecution=true
is found in the URL.If the request has to be recomputed, the Supervisor evaluates the cost of the computation. If this cost is small, the request is computed and the result is displayed on the fly. If this is not the case, the following message is displayed:
This request is too heavy to run directly and has been submitted in batch (xxxx-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)
Once the batch execution has been performed, calling the page will display the results.
String xxxx-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
is a UUID that was assigned to the execution request and that can be used as an additional parameter to display the results of the computation.
The computation cost is evaluated as follows:
If the request was executed on the fly or if results were found, the page directly displays the results of the request in the following format:
Caution: Try to avoid requesting more than 1,000 lines at once.
The Next Page and Previous Page links are implemented with URLs:
key_values
is greater than the last value of the pagekey_values
is lower than the first value of the pageCaution: The next or previous pages can miss lines if the sort indexes have no unique values, or if all the components that make the line unique are not displayed in the page. To have the right pagination, make sure you add an additional criterion that makes the line unique at the end of your sorting criteria.
The first line of the Information header has the following format:
Query QUERY_NAME computed the YYYY-MM-DD HH:MM:SS in TIME (T1+T2) seconds on NB_LINES lines
Where:
The second line of the Information header has the following format:
CURRENT_LEVEL / MAX_LEVEL >> KEY1 > KEY2 ...
Where:
Each request line whose data references another entity is associated with a hyperlink. For example, if there is any item reference on the line, a hyperlink to the details of this item is available.
Two possible links can be displayed:
The following example shows the results of a request for a total of quantity, and a total value per date, item, and customer:
At level 1
DateQuantity Amount2013/02/01 100 3000,002013/02/02 100 5000,00 -- LINE on which Lev+ is clicked2013/02/03 180 7000,00...
At level 2
Once you click the second line, the list starts with the details of date 2013/02/02. It displays four lines that split the quantity of 100 and the amount of 5000 on four items. The next lines are the decomposition of the level 1 third line and so on:
DateItem Quantity Amount2013/02/02 CD10025 1500,00 + These 4 LINES2013/02/02 CD20030 2500,00 | are the decomposition2013/02/02 CD300 5 300,00 | of the previous2013/02/02 HT10040 700,00 + line2013/02/03 CD30030 1000,002013/02/03 RD678 100 4000,002013/02/03 ZE78950 3000,00...
In cube mode, only these four lines are displayed. However, if cube mode is disabled, the next lines are also displayed.
At level 3
After clicking the fourth line, the decomposition of the quantity of 40 and the amount of 700 for item HT100 is displayed on three lines for three customers. The next lines, which will appear only if cube mode is disabled, pertain to another date and another item.
DateItem Customer Quantity Amount2013/02/02 HT100ABC1025 300,002013/02/02 HT100AGF0310 280,002013/02/02 HT100ERD76 5 120,002013/02/03 CD300ABC0020 700,002013/02/03 CD300RTG6710 300,002013/02/03 RD678AAB8980 3000,002013/02/03 RD768ERZ9020 1000,00...
The URL of the page can accept other parameters. The default URL generated from the setup of the menu item is structured as follows:
(server_URL)/html/main.html?url=/sdata/x3/$$prod/FOLDER/QUERY('REQ_NAM')?representation=QUERY~REQ_NAM~1.$query
Where:
Additional parameters can be added at the end of the URL with the following syntax: ¶meter_name=value
Example:
...QUERY('REQ_NAM')?representation=QUERY~REQ_NAM~1.$query&count=200&startRecord=1200
When the query is defined from a menu item, these parameters are entered in the Parameters section of the menu item record.
The list of parameters available is provided below:
Parameter name | Possible values | Default value | Use | Example | cube | true, false | true | The cube mode handles the display of the lines. If set to true, it enables the cube mode: only the lines contained in the current level line are displayed. If set to false, it disables the cube mode: all lines are displayed. See the example above for more details. | &cube=false |
---|---|---|---|---|
forcedExecution | true, false | false | If set to true, it forces the re-execution of the request, even if a relevant result has already been computed. | &forcedExecution=true |
frequency | 1 to 9 | 6 | Defines that a shared or personal request must be re-executed if it has not been recomputed since the revalidation of the request, or since the computation time delay elapsed according to the following values:
| &frequency=8 |
level | 1 to N | 1 | Current level of grouping for the data. This parameter usually has the same value as the last segment in the representation value. The segment in the representation value is used to determine the columns that must be displayed at the current level, whereas the parameter defines the level of aggregation used for the displayed data. | &level=3 |
linesLimit | numeric value | 0 (no limit) | This parameter is used to limit the number of computed lines. It is only useful if the request is executed and if the user wants to test a sample of data for the corresponding request. If the result is truncated because the maximum number of lines is reached, the information message will mention it: "Line number limit exceeded (NNNN)." | &linesLimit=5000 |
timeLimit | numeric value | 0 (no limit) | This parameter is used to limit the time spent for computation. It is only useful if the request is executed and if the user wants to test a sample of data for the corresponding request. If the result is truncated because the maximum time is reached, the information message will mention it: "Execution time limit exceeded (NNNN)" Caution: Make sure it does not limit the time spent by the database to compute the request, but only the cumulated time, including the fetch time. When the time is limited to 100 seconds:
| &timeLimit=20 |
startRecord | numeric value | 1 | This parameter defines the first line number displayed (used for paging). | &startRecord=3000 |
startIndex | numeric value | 1 | This parameter is generated by the paging links and is not used directly. In cube mode, the system uses the "startRecord" value to know the current group of aggregated lines. Parameter "startIndex" relates to a relative page in this group. | |
requestID | UUID in canonical format | null UUID | This parameter defines the UUID assigned to the request during computation. If the UUID is not null and it is not the right one, the request is recomputed. This is used in the paging and zooming links to make sure the request was not recomputed. If the UUID is not the right one, the following error message is displayed: "The request was recomputed". | &requestID='7ca26fea-0735-4bd1-b49d-2f3dff3a4d68' |
displayLineNum | true, false | false | If set to true, this parameter adds a column at the beginning of the grid to display the line number in the level. | &displayLineNum=true |
recordPerPage | numeric value usually from 10 to 1500 | user parameter "NBRREQ" value for query (20 if no value found), and user parameter "NBRREQBLK" in bulk mode (200 if no value found) | This parameter defines the number of lines displayed in a page. The query facet is used for a browser page, but the bulk protocol is used for the Excel client. It fetches 200 lines by default. | &recordPerPage=250 |
count | This parameter name can be used in place of the previous one. If both are defined, the "recordPerPage" value is used. | &count=130 | ||
portview | Allows to get the value of some parameters (initial level, computation frequency) from a dashboard view identified by its code. | &portview=MYVIEW | ||
where | Condition in SData format | none | This condition allows the user to add filtering conditions based on the parameters that are defined in the request definition with Range equals "true".Only simple conditions using "le", "ge", "eq", "lt", "gt" or "between ... and ..." operators can be used.If several conditions are given, they must be associated with "and". When the condition changes, the request is recomputed.Important: Only string constants (between single quotes) or numeric constant can be given. No variables nor computed expressions are allowed. | &where=(ITEM gt 'ABC') and (QTY between 100 and 200) |
first_XXX last_XXX | range value for XXX field | none | XXX must be one of the parameters of the query for which a range has been set. This is another way to create a range for a parameter, but this parameter only applies if there are no &where clauses. | Using &first_ITEM=ABC&last_ITEM=DEF is similar to &where=(ITEM between 'ABC' and 'DEF') . |
When the request execution is too heavy to be performed immediately, the Supervisor creates a batch execution request. An entry is created in the batch request table with the following information:
When the batch scheduler is on, the task is executed if the maximum number of tasks currently running does not exceed the limit. This means that the user usually triggers the execution within seconds. If the batch scheduler is on every minute, it takes an average of 30 seconds.
When the Excel link or the Mailmerge link are used, the requester switches to bulk mode by using the $bulk
facet. In this mode, the number of lines is no longer limited to 1,000.
For example, if you want to get the complete details of a request in an Excel spreadsheet with less than a million lines, you can use &cube=false&count=1000000
from the Excel plugin.
The current limits are as follows:
When a query uses graphs, the following recommendations have to be followed:
The requester generates a script called "WFname", where name is the name of the query. This script includes several subprograms called by the Supervisor layer. The main ones are:
This script is generated in a way that makes it easy to read (with comments). It does not have to be modified because it will be completely regenerated each time the query is validated. However, it might be interesting to have a look at it, especially if errors happen during execution.
This can happen if:
In this case, the error, the script, and the corresponding line are mentioned. Below is an example of an error found during the execution:
Script WFVEN073 looks like this:
# Sage X3 supervisor# Request VEN073 (Customers without any orders) 2015-09-09T07:46:06 ... # Open the tablesLocal File VIDLECUST [VIC]Local File ALISTEH [ALH]Local File AFCTFCY [Z_AFY] # Default filesDefault File "[VIC]" # Open the data file and fill them with the right headerGosub HEADRQT # Create a .lock file with UUIDOpeno filpath('RQT',REQUID,'lck') Using [LCK] : Openo Using [LCK] # Assign the additional criteriaCRITSUP(1)="([F:VIC]AUSNUM = GACTX.USER |[F:VIC]AUSNUM2= GACTX.USER)" # Entry pointLocal Char RQT_CODE(20) RQT_CODE='VEN073'Gosub EXERQT From SUBALH11 # Now let's declare the request (Link) and the fields expected (Columns)Link [VIC] With & [Z_AFY]AFF0 ~='';GACTX.APRFCOD; 'GESSOH'& As [LNK]& Where evalue(CRITERE)& & evalue(CRITSUP)& Order by Key CLE = [F:VIC]ORDDAT Columns [LNK] ([F:VIC]BPCNUM,[F:VIC]BPCNAM,[F:VIC]SOHNUM,[F:VIC]ORDDAT,& [F:VIC]CNTSOH,[F:VIC]REP1,[F:VIC]REPNAM,[F:VIC]REP2,[F:VIC]REPNAM2,& [F:VIC]SOPLIN,[F:VIC]SOQSEQ)