Quick overview

1. General information

  • A variable is a textual identifier that begins and ends with the “#” character and represents a specific value related to the web application, database, currently logged-in user, edit forms, view pages, or controls.
  • Variables are replaced on the server side with concrete values expressed as text strings.
  • Variables include:
    • General variables – for example “#loginname#” or “#today#”.
    • Database control identifiers:
      • the current value of a control in an edit form – “#ng_#”,
      • the same value in places where “#ng_#” returns a reference to the control (see below) – “#ng_:value#”,
      • the original historical value, i.e. the value stored in the database before the record is saved – “#ng_:history#”; the ID of the record before it is saved is returned by “#id:history#”,
      • the value of a “MultiListBox” control with values from a database query, where individual items are converted to their database “id” values separated by a tab – “#ng_:ids#”.
    • JavaScript variables – for example “nID”.
    • Script variables – for example “#A#”.
    • Variables used in print templates – for example “#ng_#”, “#c0”, or “#remove#”.
  • Variables may be used during application design only by administrators. Regular users do not have direct access to variable values and work with them only indirectly through applications designed by administrators. The exception are the date variables “#today#”, “#now#”, “#monday#”, “#sunday#”, “#day#”, “#month#”, “#year#” and “#lastdayinmonth#”, which a regular user may enter into view table filters.
  • Database control identifiers behave differently in an edit form in JavaScript and HTML controls, in RichText and Title controls, in control events and in the JavaScript of buttons.
    • In these places, the “#ng_#” variable provides access to the database control object within the HTML document object model of the edit form and is replaced by a call to “el('id')”, not by the value of the control.
    • The value of a database control in these places is returned by the “#ng_:value#” variable. It is the value at the moment the edit form is rendered; a value the user has changed in the web browser in the meantime must be read from the control object.
    • If a user does not have permission for the control associated with a given variable, the variable is replaced with the value stored in the database. In extreme cases, it may be replaced with an empty value, which can lead to a JavaScript syntax error (for example “var o = ;”).
  • Values substituted for variables are not escaped in any way, neither into JavaScript nor into HTML. A value entered by a user should therefore be inserted into HTML using the “HTMLENCODE” server function; there is no server function for escaping a value into JavaScript.
  • Date and time in variables (“#today#”, “#now#”, values of date controls) are always in the time zone of the NET Genium instance.

2. General variables

#cookies#

The content of the “Cookie” header of the current request, i.e. all cookies in the form “name=value” separated by a semicolon.

#comma#

A comma equivalent that can be used typically when calling server functions, and that will not be evaluated as a parameter separator.

#crlf#

Go to the new line “\r\n” resp. equivalent to pressing the “Enter” key.

#database#

Path to the currently used database. For the Firebird database, the variable contains the full path to the “fdb” file on disk; for the MSSQL database, the variable contains the name of the database.

#datagridX#

A semicolon-separated list of primary keys of all selected records in the datagrid. “X” indicates the order of the view table in the view page or edit form. The numbering starts from one, the first view table has the identifier “datagrid1”, the second “datagrid2”, etc. The variable is replaced in the context of a view page or an edit form, typically in a script, for example by storing the value in a variable (A = StringArray(#datagrid1#)). Setting a new list of selected records is possible using the server function “SETDATAGRIDSELECTION”.

#day#

The number of the current day of the month (1–31).

#dayofweek#

The number of the current day of the week (1–7).

#dayofyear#

The number of the current day of the year (1–365, in a leap year 1–366).

#defaultvalues#

Values scheduled by “SCHEDULEDEFAULTVALUE” and “SCHEDULEDEFAULTVALUES”, formatted as HTML.

#DGX#

A semicolon-separated list of primary keys of all selected records in the datagrid. “X” denotes the ID of the view table in the view page or edit form. The variable is replaced in the context of a view page or an edit form, typically in a script, for example by storing the value in a variable (A = StringArray(#DG123#)). Setting a new list of selected records is possible using the server function “SETDATAGRIDSELECTION”.

#domlib#

DomLib analysis report.

#doublequotes#

Double quotes.

#errorlabel#

The text “ERROR” followed by the content of the “Config\ErrorLabel.txt” configuration file. If the file does not exist or is empty, the variable contains an empty string.

#form#

ID of the currently open edit form. The use of the variable is only possible in the edit form.

#formname#

The name of the currently open edit form, including the name of the application and the application group in which it is located. The full name is given in the format “Application group name / Application name / Form name”.

#formopendate#

The date and time the record was opened in the edit form.

#facebook_access_token#

“Access_token” successful login to Facebook using the javascript function “loginByFacebook”.

#facebook_expires_on#

Expiration date and time of the “access token” of a successful login to Facebook using the javascript function “loginByFacebook”.

#google_access_token#

“Access_token” successfully logging in to Google using the javascript function “loginByGoogle”.

#google_refresh_token#

“Refresh_token” successful login to Google using the javascript function “loginByGoogle”.

#google_expires_on#

Expiration date and time of the “access token” of the successful login to Google using the javascript function “loginByGoogle”.

#guid#

New unique GUID.

#headers#

Report of headers of the current request and response including cookies.

#help#

Cross-application help – a summary of all help for application groups, applications, categories, view pages, edit forms, and RichText controls, labeled “Report Help.”

#id#

The ID of the currently open database record in the edit form.

#innerwidth#

The width of the view page or edit form specified in pixels in the web browser of the currently logged in user.

#innerheight#

The height of the view page or edit form specified in pixels in the web browser of the currently logged in user.

#ipaddress#

Client IP address. The “ipaddress2” variable must be used in the “Invalid login” form, because the “ipaddress” variable in this edit form indicates a control. If the connection to the server is mediated using IPv6, the content of the variable is an IPv6 address.

#ipaddress2#

The client's IP address used in the “Invalid login” edit form, where the “ipaddress” variable indicates an edit form control. If the connection to the server is mediated using IPv6, the content of the variable is an IPv6 address.

#language#

Abbreviation of the language of the currently logged in user: “ar”, “cs”, “de”, “en”, “fr” or “sk”.

#lastcondition#

SQL condition of the last evaluated database query.

#lastdayinmonth#

The date of the last day of the current month.

#lastjoin#

SQL join definition of the last evaluated database query.

#lastquery#

SQL statement of the last evaluated database query.

#lastqueryid#

ID of the last evaluated database query.

#lastvalue#

The value of the given control in the most recently created database record (the record with the highest ID) owned by the current user. It is selected from the records that have the same PID as the currently created record; PFORM is not compared. The variable can only be used as the whole default value of the control.

#lastvalue2#

The value of the given control in the most recently created database record (the record with the highest ID) owned by the current user. It is selected from all records in the database, regardless of the PID column. The variable can only be used as the whole default value of the control.

#loginname#

Login name of the currently logged in user. The “loginname2” variable must be used in the “User” form, because the “loginname” variable in this edit form indicates a control.

#loginname2#

The login name of the currently logged in user in the “User” edit form, where the variable “loginname” indicates the control.

#logs#

List of all log files located in the “Logs” directory with the possibility of downloading them.

#machinename#

The name of the computer on which NET Genium is hosted.

#microsoft_access_token#

“Access_token” of a successful login to Microsoft using the javascript function “loginByMicrosoft”.

#microsoft_refresh_token#

“Refresh_token” successful login to Microsoft using the javascript function “loginByMicrosoft”.

#microsoft_expires_on#

Expiration date and time of the “access token” of a successful login to Microsoft using the javascript function “loginByMicrosoft”.

#mappicker#

Link to the map picker, which is used to select coordinates on OpenLayers maps.

The variable can only be used in the help of a control; only its first occurrence is replaced.

#mappickergoogle#

Link to the map picker, which is used to select coordinates on Google maps.

The variable can only be used in the help of a control.

#monday#

The date of the first day of the current week.

#month#

Current month number (1-12).

#nid#

The ID of the database record that was last created in the script by the “New record” command.

In the “OnAfterSave” script, the variable contains the ID of the last database record created in the “OnBeforeSave” script. In the “OnAfterDelete” script, the variable contains the ID of the last database record created in the “OnBeforeDelete” script. If it is necessary to know the value of the variable “nid” within one script, it is necessary to use the server function “COMMIT”, which immediately performs all entries in the database and does not wait for the successful completion of the entire script.

#noreply#

The e-mail address of the default sender of all messages, or if not defined, the e-mail address “noreply@name_net_genium.domain”. The domain depends on the language of the user: “cz” for Czech, “de”, “fr” and “sk” for German, French and Slovak, “com” for other languages.

#now#

Current date and time in the format “dd.MM.yyyy HH:mm”. The separator and the order of day and month depend on the language of the user and on the date format in the NET Genium settings.

#now2#

Current date and time in the format “dd.MM.yyyy HH:mm:ss”. The separator and the order of day and month depend on the language of the user and on the date format in the NET Genium settings.

#null#

Database value “null”. The use of a variable only makes sense in a script, when it is necessary to write the database value “null” into the control in the edit form, or to write the same value anywhere in the database using a query. As a whole value it can also be used in a join condition of a database query and in a compound condition of a script.

#ocrserver#

OCR Server set up using the configuration file “Config\OCRServer.txt”.

#owner#

A reference to the hidden field of the edit form with the ID of the record owner. For a new record, changing the value of this field in JavaScript determines the owner that is set for the record when it is saved; for an existing record, the owner is always read from the database and a change of the field value has no effect.

The use of the variable is only possible in JavaScript of the edit form.

#passwordhelp#

Password creation help based on the required password strength defined in the NET Genium settings.
If the password strength is set to “None”, the variable contains an empty string. The use of the variable is only possible in the help.

#passwordlength#

Required length of user passwords depending on the set password strength. 12 for strong, 8 for everyone else.

#pform#

The ID of the parent record edit form. The use of the variable is only possible in the edit form.

#pid#

Parent record ID.

#plannerfrom#

The start date of a planning calendar event when a new event was created or an existing one was moved (to another source or time).

#plannerid#

Schedule calendar event ID when a new event was created (returns “0”) or an existing one was moved (to another source or time). If table joins are used in the data source for the scheduler, this variable contains both the record ID from the source table and the record IDs of all accepted tables in the same order in which the join is set. These values are then separated by a semicolon.

#plannerresource#

The name of the scheduling calendar event source when the new event was created or an existing one was moved (to another source or time).

#plannerresourcefrom#

The name of the original scheduling calendar event source when the event was moved to another source.

#plannerresourceto#

The name of the new scheduling calendar event source when the event was moved to another source.

#plannerto#

The end date of the scheduling calendar event when a new event was created or an existing one was moved (to another source or time).

#png#

In web browsers that can display transparent “png” images, the variable contains the string “png”, in others it contains the string “gif”.

#portal#

Name NET Genium.

#richtextboxX#

The value of the X-th RichTextBox control on the view page. Numbering starts from one.

#rightsgroups#

A table of all rights groups, where the first column lists the rights group name, and the second column lists all user groups and users assigned to that rights group.

#rightsgroups2#

Matrix of all rights groups vs. all user groups that are assigned permissions to that group.

#root#

URL to the “root” directory of NET Genium without a slash at the end, for example “https://www.netgenium.com/test”.

#rootpath#

Full path to the “root” directory of NET Genium, including a backslash at the end.

The variable is not available in the NET Genium Online cloud edition — it stays in the text in its original form.

#sessionid#

A unique string identifying the currently logged in user.

#sharp#

A sharp equivalent that can be used typically when calling server functions, and that will not be evaluated as the start or end character of a variable.

#sngscript_stats#

Aggregated script execution statistics report based on data generated by simple or complete logging of NET Genium traffic.

#squerybuilder_stats#

Aggregated report of database query evaluation statistics based on data generated by simple or complete logging of NET Genium traffic.

#stables_stats#

Aggregated report of statistics of generation of edit forms based on data generated by simple or complete logging of NET Genium operation.

#sunday#

The date of the last day of the current week.

#sviewpages_stats#

Aggregated report of statistics of generating view pages based on data generated by simple or complete logging of NET Genium traffic.

#tab#

Tab “\t” resp. equivalent to pressing the “Tab” key.

#textboxX#

The value of the X-th TextBox control on the view page. Numbering starts from one.

#timetablefrom#

The start date of the Gantt chart event when the new event was created.

#timetableto#

The end date of the Gantt chart event when the new event was created.

#timetableresource#

The name of the Gantt chart event source when the new event was created.

#timezones#

A semicolon separated list of the identifiers of all time zones, for example “Europe/Prague” or “America/New_York”. It is used as the source of the values of a ComboBox control in which the user selects their time zone — only “#timezones#” is written into the “Values” property and the list is filled in when the control is rendered, so it is always up to date.

#today#

Current date in the format “dd.MM.yyyy”. The separator and the order of day and month depend on the language of the user and on the date format in the NET Genium settings.

In places where a date is expected, the syntax “#today# + 1” (tomorrow), “#today# - 7” (seven days ago), “#today# + 1m” (in a month), “#today# + 1y” (in a year) or “#today# + 12h” (in twelve hours) can be used. An offset without a unit means days and may also be a decimal number. The operator is always the “+” character or the hyphen “-”, not a dash. Only one operator can be used (it is not possible to write e.g. “#today# + 2y + 7m + 3” or “#today# +2y7m3”); an unsupported notation does not raise an error, the date is just not shifted by the intended value.

#usergroup#, #usergroupname#

A semicolon-separated list of all user group names that the currently logged on user is a member of.

#usergroupid#

A semicolon-separated list of all user group IDs in which the currently logged on user is a member.

#userid#

The ID of the currently logged in user.

#useridentity#

The identity of the user authenticated by the operating system.

#username#

The full name of the currently logged in user.

#usergroups#

List of all user groups and users placed in these groups.

#usersonline#

A table of currently logged in users with links for sending a message and for the message history. An administrator and a user account administrator also have a link for logging a user out; other users do not see this link.

#usersonline1#

Number of currently logged-in users who consume a regular license (including members of the “External Users” group with three or more user groups).

#usersonline2#

Number of currently logged in users with an external license.

#url#

The URL of the currently open website.

#utcnow#

Current date and time in UTC in the format “dd.MM.yyyy HH:mm”.

#utcnow2#

Current date and time in UTC in the format “dd.MM.yyyy HH:mm:ss”.

#viewpage#

The ID of the currently open view page.

#week#

The number of the current week of the year.

#wikihelp#

Contains help text for wiki formatting. The use of the variable is only possible in the help.

#wikihelp2#

Contains help text for wiki formatting, intended for eLearning application. The use of the variable is only possible in the help of the eLearning application.

#year#

Current year number.

3. Variables used in printing templates

3.1. List of variables

barcodeX, Y

An image of a barcode that is built based on an alphanumeric string stored in capital letters in a given control. The “X” parameter indicates the width of the image, the “Y” parameter the height of the image.

For example: “#ng_code@barcode320,240#”.

barcodeX, Y, Z

An image of a barcode that is built based on an alphanumeric string stored in capital letters in a given control. The “X” parameter indicates the width of the image, the “Y” parameter the height of the image. The “Z” parameter is optional and specifies the percentage size of the image in the case of print templates and MS Excel. For HTML print templates, the “Z” parameter specifies a value of “true” or “false”, which indicates whether a label with barcode text should also be generated in the barcode. If this parameter is not specified, the value “true” is automatically used.

For example: “#ng_code@barcode320,240,50#” (MS Excel) or “#ng_code@barcode320,240,false#” (HTML).

barcodeA,B,C,D

An image of a barcode that is built based on an alphanumeric string stored in capital letters in a given control. Parameter “A” indicates the width of the image, parameter “B” indicates the height of the image. Parameters “C” and “D” are optional. Parameter “C” specifies the percentage size of the image in the case of print templates and MS Excel. The “D” parameter specifies the value “true” or “false”, which indicates whether a label with the barcode text should also be generated in the barcode. If this parameter is not specified, the value “true” is automatically used.

For example: “#ng_code@barcode320,240,50,false#”.

#c0#, #c1#, c2#...

The column values of the view table that is the result of the aggregate database query. The variable “#c0#” indicates the first column, the variable “#c1#” the second, etc. When printing, NET Genium searches for a row with the occurrence of these variables and then copies it under itself as many times as there are records in the view table. It then replaces the variables with the values from the view table.

#calendarX#

A placeholder for the calendar that will be copied to the print template when printing – the place in the print template where the calendar will be placed. An “X” indicates the order of the calendar on the view page or edit form. Numbering starts from one, the first calendar has the identifier “calendar1”, the second “calendar2”, etc.

#datagridX#

A placeholder for the view table that will be copied to the print template when printing – the place in the print template where the view table will be placed. An “X” indicates the order of the view table in the view page or edit form. Numbering starts from one, the first view table has the identifier “datagrid1”, the second “datagrid2”, etc.

#date1#

Start date of the filtered view table time period.

#date2#

End date of the filtered view table time period.

#DGX#

Placeholder for the view table that will be copied to the print template when printing - the location in the print template where the view table will be placed. “X” indicates the datagrid ID (JavaScript element name).

#f0#, #f1#, #f2#...

Filters of a view table, calendar or chart in the form “column name: selected item”, for example “Status: Active” or “Price: <= 100”. If nothing is selected in a filter, the variable contains only the column name with a colon. The variable “#f0#” indicates the first filter, the variable “#f1#” the second, etc.

In the conditions and expressions of a statistical (aggregate) database query, the variables “#f0#”, “#f1#”... have a different content: the SQL condition that NET Genium builds from the item selected in the filter, not the selected value itself. There, “#f0#” corresponds to the first column of the query of the “Filter” type, “#f1#” to the second one, etc.; if nothing is selected in the filter, the variable is empty. The variables “#date1#” and “#date2#” contain the time period of the same view table in a query condition. These variables are not replaced in a script.

#filters#

A list of all filters of a view table, calendar or chart in the same form as “#f0#”, separated by a comma. If the print template is adapted to print multiple view tables at once, the full form of the identifier can be used.

For example: “#datagrid1#.#filters#”.

#chartX#

A placeholder for the chart image that will be copied to the print template when printed – the location in the print template where the chart image will be placed. An “X” indicates the order of the graph in the view page or edit form. The numbering starts from one, the first graph has the identifier “chart1”, the second “chart2”, etc.

#identifiers#

A list of database control identifiers that can be used in the print template. If the print template is adapted to print multiple view tables at once, the full form of the identifier can be used.

For example. “#datagrid1#.#identifiers#”.

image

An image that is stored in the form of its ID in a given variable or control.

For example: “#A@image#” or “#ng_image@image#”.

imageX

An image that is stored in the form of its ID in a given variable or control. The “X” parameter indicates the percentage size of the image.

For example: “#A@image50#” or “#ng_image@image50#”.

qrcodeXY

An image of a QR code that is compiled based on a string stored in a given control. The “XY” parameter indicates the image size in the range of 1 to 100.

For example: “#ng_code@qrcode3#”.

qrcodeXY,Z

An image of a QR code that is compiled based on a string stored in a given control. The “XY” parameter indicates the image size in the range of 1 to 100. The “Z” parameter is optional and specifies the percentage size of the image in the case of MS Excel print templates.

For example: “#ng_code@qrcode3,50#”.

3.2. Formatting control values

The format of the values inserted in the print template can be specified by adding an at sign after the appropriate control identifier. Pattern: “#ng_element@FORMAT#”, where the following variables can be substituted for FORMAT:

fixedheight

For the “xls” and “xlsx” print templates, it changes the way the row height is set for cells that have “Wrap text” checked in the format on the “Alignment” tab – it prevents automatic calculation and setting of the row height according to its content.

html

For “xls” and “xlsx” print templates, it changes the way text is inserted, and allows easy formatting using the “b”, “strong”, “i”, “em”, “u”, “sub” and “sup” tags.

number

It changes the decimal comma of a number to a decimal point and removes the currency specification.

dph1

Reduced VAT rate valid on the given day.

dph2

Increased VAT rate valid on the given day.

dph1X

Reduced VAT rate valid on a given day in a specific country. The variable “X” must be replaced by the identifier of the control in which the country code is stored. Supported country codes: AT, BE, BG, CY, CZ, DE, DK, EE, EL, ES, FI, FR, GB, GR, HR, HU, IE, IT, LT, LU, LV, MT, NL, PL, PT, RO, SE, SI, SK, UK. Country codes cannot be written directly instead of the control identifier.

dph2X

Increased VAT rate valid on a given day in a specific country. The variable “X” must be replaced by the identifier of the control in which the country code is stored. Supported country codes: AT, BE, BG, CY, CZ, DE, DK, EE, EL, ES, FI, FR, GB, GR, HR, HU, IE, IT, LT, LU, LV, MT, NL, PL, PT, RO, SE, SI, SK, UK. Country codes cannot be written directly instead of the control identifier.

w

The number of the week calculated for the given day.

ww

The number of the week calculated on the given day, supplemented by the initial zero.

www

Contains the number of the week on the relevant date in the specified identifier in the format WW/YYYY.

For example: 01/2013

In all other cases where the control identifier is a date, formatting constants from the FORMATDATE server function can be used.