AMT Help Files

System Items

The following default system items are defined for AMT applications:

System Item

Description of the system item.


AMT Objects: Where this system item can be used e.g. Form / Report
Access: Readonly or Writeable
Type: Value Type

DEVELOPMENT

Determines whether the application should behave as a production version or development/test version.

In the code, you can implement different behaviours for the production version and the test version of your application, depending on the parameter setting.

The Development parameter can be set in the ControlCenter screen "System Configuration → System Setup → Runtime behaviour configurations → General behaviour". It can not be changed through the source code.


Form / Report
Readonly
Boolean

ERROR

Determines whether a table query INSERT can be performed or not. You can only insert values through a table query if the ERROR value is "FALSE".

After one of the commands CLOSEFORM, GOTOFORM, REFRESH, SHOWPOPUP or SWITCHTO has been executed in the code, inserts are no longer allowed until the form has been reloaded or the new (popup) form has been loaded. Therefore these commands will set this system item to True.

In a form after this system item has been set to True and a Send Message (SME) has been sent, the display_main section of the form will not be performed.


Form / Report
Writeable
Boolean

GETLASTRESULT

Stores complementary data when RESOK is set. It also stores the result in case of an unsuccessful call. A custom string can be assigned to GETLASTRESULT, but be aware that the value will be overwritten when the next command, which sets GETLASTRESULT, is executed.


Form / Report
Writeable
String

RESOK

Stores a boolean value that indicates whether an action has been performed successfully or not.

In the following cases RESOK is set to "TRUE":

  • Before the execution of a query that does not perform an UPDATE.
  • Before one of the following commands is executed:

    • READFILE
    • STARTREPORT
    • START
    • GOTOFORM
  • When an item request (through either a function or dynamically set property) is executed successfully.

In the following cases RESOK is set to "FALSE" afterwards:

  • If no data can be found with a query or READFILE instruction
  • If attempting to assign an invalid value to DATERESULT.
  • If an array item is called, except for layout controls within bounds.
  • If a REPLACE instruction is attempted in which an invalid <Position> is specified.
  • If an application link cannot be established.
  • If a START command fails, and the report cannot be started.
  • If a STARTREPORT command cannot invoke a report.
  • If a COMPARE command finds both extract files empty.
  • If a COPY instruction is attempted in which an invalid <Position> is specified.
  • If an arithmetic overflow occurs.
  • If attempting to open a non-existing form with GOTOFORM.
  • If an UPDATE for a tablequery is done without having read the record.
  • In specific situations when a cursor query could not be executed. A number indicating the reason will then be stored in the system item SI-DBSTATUS.
  • If the application was generated with the Generation Sets option "Duplicate Record Insert" set on "Warning in log files" or "No warning" and there is an attempt to insert a duplicate record in the database.
  • If an item request (through either a function or dynamically set property) is invalid, f.i. because the specified item index number is out of bounds.
  • If a ToXml or, ToJson function on a list or class fails.

The value of RESOK can be directed to another variable with RESULTOKTO.

More specific information is stored in the system item GETLASTRESULT.

Examples:

q_user.index (i_actual)
q_user.equal (sa-usercode)
q_user.getfirst ()
if resok
    sa-userstatus := 'A'
else
    q_user.index (i_history)
    q_user.equal (sa-usercode)
    q_user.getfirst ()
    if not resok
        smex ('No user with code ' + sa-usercode + ' found!')
    else
        sa-userstatus := 'H'
    endif
endif

warning Since the value of resok is set in many different cases it should be used very carefully. The following is a commonly made mistake:
q_table.index (i_table)
q_table.equal (sa-key1)
q_table.getfirst ()
if not resok
    if SearchWithSecondKey.enabled
        q_table.index (i_table)
        q_table.equal (sa-key2)
        q_table.getfirst ()
    endif
endif
if resok
    sa-result := q_table.name
endif

Suppose the query gives no result with sa-key1 and SearchWithSecondKey is not enabled.
The execution of 'if SearchWithSecondKey.enabled' sets resok to True but the second query is not executed because the if statement results in False. So resok remains True and the 'if resok' statement will be executed. sa-result will then be updated with an empty q_table buffer.

In such cases it is better to use a switch variable:

q_table.index (i_table)
q_table.equal (sa-key1)
q_table.getfirst ()
if resok
    sw-found := true
else
    if SearchWithSecondKey.enabled
        q_table.index (i_table)
        q_table.equal (sa-key2)
        q_table.getfirst ()
        if resok
            sw-found := true
        endif
    endif
endif
if sw-found
    sa-result := q_table.name
endif

Form / Report
Writeable
Boolean

SI-APPLICATIONCAPTION

Stores text to be added to the AMT Screens window caption. In Web Browsers this will show in the label of the Application Center tab.

The value can be changed dynamically in the code.

Administrators may add additional texts to the title bar through the ControlCenter-screen "System Configuration > System Setup > Runtime behaviour configurations > Form appearance". If the option "Show database name in caption" is checked in that screen, the SI-APPLICATIONCAPTION value will be displayed directly after the concerning database name.


Form
Writeable
String

SI-APPLICATIONNAME

Contains the name of the application as stored in the Control Center. The names of the applications are visible in the list in "System Configuration > Architecture > tab Applications".


Form / Report
Readonly
String

SI-APPLICATIONPATH

Contains the path to the installation directory of the application as stored in the Control Center. The path is visible when an application is viewed in "System Configuration > Architecture > tab Applications" in the properties tab as "Application base path".


Form / Report
Readonly
String

SI-BASE

Stores the value of the year that represents the daynumber zero, which is used in conjunction with relative day numbers (number of days after SI-BASE) to calculate a date value for the DATERESULT object.

Normally (if the application has been created in LION), SI-BASE contains the value "1900". However, if your application was converted from LINC, this system item contains the SI-BASE that was set for that application.

The SI-BASE value is displayed in the options screen for your application.


Form / Report
Readonly
Numeric 4

SI-CENTURY

Holds the first two digits of a century notation in DATERESULT. If the DATERESULT value is changed, the value for SI-CENTURY will be changed automatically if needed. This means that if the value for DATERESULT is set for example to "2002", and the value for SI-CENTURY is not yet "20", SI-CENTURY will be set to that value.


Form / Report
Writeable
Numeric 2

SI-COMSERVICE

If the connection to the application server runs through a communication service, the server name of the comservice will be set in this system item. In other situations, this system item will be empty.


Form
Readonly
String

SI-CURRENCYSIGN

Holds the character to use for the currency symbol.


Form / Report
Writeable
Alpha 1

SI-CURRFORM

SI-CURRFORM contains the name of the current form with the implemented routine. This system item is also available outside a form, but it will not be filled with any value then.


Form / Report
Readonly
String

SI-CURRLEFT

SI-CURRLEFT reflects the left position of the focused field in relation to the parent object (groupbox, panel, tabsheet, etc)

If the focused field does not have a parent, SI-CURRLEFT represents the absolute left position on the form.

The SI-CURRLEFT is measured in pixels. The position on the form or parent's left top represents by SI-CURRTOP = 0 and SI-CURRLEFT = 0.


Form
Readonly
Numeric 6

SI-CURRTOP

SI-CURRTOP reflects the top position of the focused field in relation to the parent object (groupbox, panel, tabsheet, etc).

If the focused field does not have a parent, SI-CURRTOP represents the absolute top position on the form.

The SI-CURRTOP is measured in pixels. The position on the form or parent's left top represents by SI-CURRTOP = 0 and SI-CURRLEFT = 0.


Form
Readonly
Numeric 6

SI-DATECONVERTBASE

Stores the value that represents the first year of a 100 years period. This value is used in conjunction with SI-BASE to calculate a full date value out of six digit dates, which are expected to be in that period.

If SI-DATECONVERTBASE is not set, it will contain the same value as SI-BASE. When executing the display logic, SI-DATECONVERTBASE will be reset to its default value (which is entered in the Application options screen).


Form / Report
Writeable
Numeric 4

SI-DBNAME

Contains the name of the current LION runtime database.


Form / Report
Readonly
String

SI-DBSTATUS

Cursor queries, Free join queries and Table queries will set SI-DBSTATUS if the corresponding option is enabled in either the Application Options or the Form / Report options.

Stores a number (1 until 6 or 99) indicating the reason why a table or cursor query could not be performed successfully. The meaning of the number is as follows:

Value: Explanation:
1 Record not found
2 Duplicate insert
3 Duplicate update
4 Deadlock
5 No current record
6 Foreign key constraints conflict.
99
A database exception occurred

Form / Report
Writeable
Numeric 2

SI-DBTYPE

Holds the type of database of the runtime. Possible values are: MSSQL, ORACLE and DB2


Form / Report
Readonly
Alpha 10

SI-DEBUG

Evaluates "TRUE" if a form or report is started in debug mode, otherwise the value of this system item is "FALSE". Generation is no longer of consequence.


Form / Report
Readonly
Boolean

SI-ENVIRONMENT

Returns the environment name from the system settings as defined in the Control Center.


Form / Report
Readonly
String

SI-FILEID

Stores the result of the 'COMPARE ... ENDCOMPARE' command. During the comparing process, the system item SI-FILEID will be filled with: spaces if the records in the file IDs match, the file ID with the lower value if the key is set to ascending or the file ID with the higher value if the key is set to descending.


Form / Report
Readonly
String

SI-FOCUSEDFIELD

Holds the name of the layout control that was active when the screen was sent.

If referring to this system item, keep in mind that it is case sensitive.

E.g. to check if the layout control "LBX_CUST" is currently selected, the following code is written:

 if si-focusedfield = 'LBX_CUST'
   sendmessage ('The field LBX_CUST is currently selected.')
 else
   sendmessage ('The field LBX_CUST is currently not selected.')
 endif

The apostrophes in this example are needed because otherwise "SI-FOCUSEDFIELD" would be compared with the value for LBX-CUST.


Form
Readonly
String

SI-FORMINPUT

This system contains the concatenated form input; concatenated form input is the contents of all edit fields, concatenated in order of top/left positions.

  • SI-FORMINPUT only takes edit-fields. No other fields are taken in this system item.
  • Only edit fields on visible panels are part of the input
  • On the other hand, edit fields that are invisible or disabled individually, do take part in the input string.
  • Any fields after the focused field are not considered as input; the focused field itself is included entirely.
  • Alpha fields are taken entirely, including trailing spaces for left-aligned fields and including leading spaces (as many as necessary) for right-aligned fields.
  • Numeric fields are included according to their formats.
  • If no Format defined, the decimal sign is part of the Numeric display in SI-FORMINPUT.
  • For signed numeric fields, the minus sign is added, when the item is negative and a space when the item is positive.
  • SI-FORMINPUT only holds the concatenated fields of the active parent (Scrollbox, panel, groupbox or tabsheet)

The LionDev generator and the runtime library have been changed to implement this feature. Therefore it is independent of which client connects (Web or AMT Screens)

routine process_main
begin_routine
    memo_0 := 'Forminput: ' + si-forminput + '@0D@@0A@'
    memo_0 += 'Left: ' + si-currleft + '@0D@@0A@'
    memo_0 += 'Top: ' + si-currtop + '@0D@@0A@'
    memo_0 += 'Field: ' + si-focusedfield
    refresh ()
end_routine

Form
Readonly
Realstring

SI-GENDATE

Stores the date when the object was generated in the format CCYYMMDD.


Form / Report
Readonly
Numeric 8

SI-GENTIME

Stores the time when the object was generated in the format HHMM.


Form / Report
Readonly
Numeric 4

SI-HELPSCREENWEB

Contains the name and location of the screen that must be displayed to the end-user when pressing "F1" in AMT Screens. So, by resetting this system item in many objects, you can provide the end-user with the most relevant information.

An administrator refers to this system item the ControlCenter screen "System Configuration > Architecture > Applications > Application details > tab Lion properties > tab Server > Help Command".


Form
Writeable
String

SI-HEX00VALUE

Holds the value "@00@".


Form / Report
Readonly
Alpha 1

SI-HIGHVALUE

Contains (hexadecimal) FF character. This system item can be used to fill the characters in a field with the hexadecimal value "FF" (or "#255", depending on format).

E.g.:

S3 := SI-HIGHVALUE

If in this example "S3" is an alphanumeric field, then all characters will get the hexadecimal value "FF". If it is a hexadecimal field, then all characters will become "#255",
if it is a numeric field, then all characters will become nines ("9").

The hexadecimal value FF will be displayed as ÿ in the Microsoft® Windows Latin-1 extended character set.


Form / Report
Readonly
Alpha 1

SI-HTTPSTATUSCODE

Stores the resulting HTTP status code after performing a consumable REST API web service call.

Primarily used to determine the correct response type if multiple responses are defined in a REST API Web Service routine.
Example:

ResponseString := CRA_PETSTORE.GETPETSBYPETID(PetId)
STARTCASE SI-HTTPSTATUSCODE
CASE 200
    PetObject := CRA_PETSTORE.PETS.FROMJSON (ResponseString)
ELSE
    ErrorObject := CRA_PETSTORE.ERROR.FROMJSON (ResponseString)
    SME('Error: ' & ErrorObject.code & ' - ' & ErrorObject.message)
ENDCASE

Form / Report
Writeable
Numeric 3

SI-INITIATOR

Stores the station name of the client that started a transaction, e.g. "PC-001". The content of the station name depends on the station resolve setting.

If multiple connections are opened from the same pc, a connection number will also be stored in SI-INITIATOR. So, for example a second connection from the machine "PC-001" is stored in SI-INITIATOR as "PC-001\1", a third as "PC-001\2", etc.

Using the web module with the switch GENERATEUSERACCOUNT set to "TRUE", SI-INITIATOR will be filled with a unique station name for the web session. This parameter is read when a user logs on to this module.


Form / Report
Writeable
Alpha 30

SI-ISWEBENABLED

Evaluates "TRUE" if a form has been set as Web Enabled, otherwise the value of this system item is "FALSE".


Form
Readonly
Boolean

SI-LANGUAGE

Stores the language definition that must be used as default in the runtime multi-language application.

To change the value for this system item through the logic, the language definition must be specified in UPPERCASE. By assigning the value "DEFAULT" to SI-LANGUAGE, it will be set to the value that is specified as default language in the Application options screen "Languages".

By using SI-LANGUAGE in conditions, it is also easy to refine the behavior on runtime, depending on the actual language setting.

At runtime, if an object for the stored language is available, then that form will be displayed. If no form with that language is available, then the default language form will be displayed.

The initial value for this system item can be set in the Users tab in the Security page of the Control Center, or through the COM interface with the Language property. If you choose the value "Default", the default language will be shown to the specified user. End users have an option to set the SI-LANGUAGE value through the AMT Screens environment. See also the "LION Administration manual".


Form / Report
Writeable
Alpha 10

SI-LENGTH

When an Unstring command is performed this system item will be set to the length of the returned string including trailing spaces.


Form / Report
Readonly
Numeric 9

SI-LEVELBREAK

Contains the name of the variable that caused the levelbreak routines to be executed.


Report
Readonly
Alpha 128

SI-LIONVERSION

Holds the current AMT version number.

The SI-LIONVERSION is always built as:

<Major release number>.<Minor Release number>.<Build number>.<Build revision number>

For example, AMT 25 has the value of "8.0.17279.0".


Form / Report
Readonly
Alpha 20

SI-LOWVALUE

Contains (hexadecimal) 01 character (Start of Heading). This system item can be used to fill the characters in a field with the hexadecimal value "01".

E.g.:

S2 := SI-LOWVALUE

If in this example "S2" is an alphanumeric field, then all characters will get the hexadecimal value "01". If it is a numeric field, then all characters will become zeroes ("0").


Form / Report
Readonly
Alpha 1

SI-NTLOGIN

Stores the NT-user name of the client.


Form / Report
Readonly
Alpha 17

SI-ORIGIN

If a form is called from outside the application through an Application link, this system item holds the name of the runtime database (= SI-DBNAME value) that is used by the calling application. E.g.: if App1 connects to App2 using an Application Link, the SI-DBNAME value for App1 will be copied to SI-ORIGIN in App2.

If the application is run and there is no external call executed to the concerned application through an Application link or if a Report is started separately, the value of SI-ORIGIN for the concerned application/report is set to spaces ('').


Form / Report
Readonly
Alpha 30

SI-PARAM

This system item is used in call routines and routines in reports to pass parameters to the routine and to receive results.

Max size of SI-PARAM is 64K (Unicode)characters.


Form / Report
Writeable
Alpha (length depends on the setting "SI-PARAM size" in the Application options screen.)

SI-PARAMFLAG

This boolean system item is set to True in a report executing a WAIT command and a WAKEUP with data has been received.


Report
Readonly
Boolean

SI-PREVFORM

Contains the name of the previous active form.


Form
Readonly
String

SI-PROCESSID

Contains the process-id that Windows has assigned to the current process.


Form / Report
Readonly
Numeric 10

SI-PRODUCT

If the system is running in Development mode, then the value for this system item is "LIONDEV". Otherwise, the value is "LION".


Form / Report
Readonly
Alpha 10

SI-RECOVER

Stores whether a report has been recovered. The default value for this system item is "FALSE".

In the Control Center, a crashed report can be recovered with the option "Recover from crash point". If a report has crashed, and you have modified (repaired) this report afterwards, you can select this option to proceed from the point where the crash occurred.

E.g. SI-RECOVER = TRUE


Report
Writeable
Boolean

SI-REPNAME

Holds the name of the report.


Form / Report
Readonly
String

SI-REPORTRESULT

Stores the result value for the current report. This value can be used in the batch, by reading the variable "ERRORLEVEL".


Report
Writeable
Financial 6

SI-REPUNIQUE

Holds a unique number for each report at runtime.


Form / Report
Readonly
Numeric 15

SI-RESTAPIMETHOD

Stores the Method (e.g. GET/POST/PUT/PATCH/DELETE) of the concerned REST API web service.


Form
Readonly
String

SI-RESTAPIPATH

Stores the Route Path of the concerned REST API web service.


Form
Readonly
String

SI-REVISION

Contains the revision ID that is assigned to the object when it was generated.


Form / Report
Readonly
String

SI-SELECTFORM

Gets the value "TRUE" if an end-user calls a screen with the AMT Screens option "Select - Select screen". In all other cases the value will be "FALSE".

By using this system item, you can avoid that end-users call a form directly with the "Select screen" option instead of using the links (menus) that you have built in the application.


Form
Readonly
Boolean

SI-SERVERNAME

Contains the NT-server name. In forms, this is the server that runs the Application server. In reports this is the name of the server that runs the AMT Batch Contoller.


Form / Report
Readonly
Alpha 17

SI-SOAPHEADER

Stores the Soap header of the concerned web service.


Form / Report
Writeable
String

SI-SOAPRESULT

Stores a result value for a specific web service call.


Form / Report
Writeable
String

SI-SQLCODE

Stores a result value for SQL queries. The possible result values are:

0 : Successful
1 : The statement ran, but a warning was generated.
100: No data matching the query was found, or the end of the results set was reached. No rows were processed
< 0: The statement did not run, due to an application, database, system, or network error.

The actual error can be found by reading GETLASTRESULT.


Form / Report
Readonly
Numeric 9

SI-STOPREPORT

Stores a Boolean value that indicates whether a jobs was requested to stop e.g. from the Job Management Running jobs tab. When SI-STOPREPORT is set to True and a COMMIT command is performed, an EXIT ALL command will be executed.

This item can either be used in combination with a COMMIT command or it can be checked in a report to perform a custom written end to the report.

The default value is "FALSE".


Report
Readonly
Boolean

SI-SUBSESSNO

Holds the serial number for the current sub session.

This system item is only usable in LION applications that are run in AMT Screens and use popup screens or provide support for multiple tabforms. The tabforms setting is controlled through the Application options screen.

Form
Readonly
Numeric 6

SI-SUBSESSCOUNT

Holds a value that represents the number of sub sessions that is currently opened.

This system item is only usable in LION applications that are run in AMT Screens and use popup screens or provide support for multiple tabforms. In other situations, the returned value will always be "1". The tabforms setting is controlled through the Application options screen.


Form
Readonly
Numeric 6

SI-TASKVALUE

Holds a value that can be read or changed through an external script.
The Task Value string value uses the following syntax:

<TASK><TASKVALUE value=your_value /></TASK>

Or for custom Task Value keys:

<TASK><Key1 value=your_value /><Key2 value=your_value />< etc ... /></TASK>

Where KeyN can be a custom name.
Example: <TASK><CustNo value=8675309 /></Task>


Report
Writeable
String

SI-TRANNO

Stores a unique number for each screen transaction that is sent by a single client. The value for SI-TRANNO is in the range 000001 to 999999.


Form / Report
Readonly
Numeric 6

SI-TRANSORIGIN

Stores a value in order to indicate the type of environment for the current transaction. The value is one of the following:

  • C: indicates a connection from the LION COM module.
  • G: indicates a connection from an Application link.
  • S: indicates a connection from a Provided web service.
  • T: indicates a connection from AMT Screens.
  • W: indicates a connection from the Webclient.

Note: When SI-TRANSORIGIN is used in a global Routine and being called from a report, it will have a space as value.


Form
Readonly
Alpha 1

SI-TRANTIME

Stores the time of the start of a transaction. This is the start of a report or the last commit.


Form / Report
Readonly
Numeric 8

SI-UNIQUE

Stores a unique number for every transaction.


Form / Report
Readonly
Numeric 12

TODAY

Obtains current date and time.

The value can be returned in one of the following date or time formats:

(formats)
CCYY-MM-DD,
CCYYMMDD,
CCYMMDDHHMMSSNNN,
DATE-NUM,
DATETIME,
DAY,
DAYNUM,
DDDD,
DDMMMYY,
HHMMSSNN,
HHMMSSNNN,
MMDDYY,
MMMDDYY,
MONTH,
MONTH-NUM,
WEEKDAYNO (value can be "1" till "7"),
YYDDD,
YEAR,
YYMMDD,
YYMMMDD,
YYMM.

Also see the command description of this system item.


Form / Report
Readonly
Numeric (length depends on format, see command description).