Skip to main content

Server global variables

Server-side variables are defined and used on the server side actions, i.e. on SQL type actions and Server-side Javascript actions.
Variables can be referred on SQL actions using a double period + an upper-case expression (e.g. :USERNAME, :LANGUAGE_ID, etc.).
Variables can be expressed in Server-side Javascript acitons using the "camel mode"-like variabes (e.g. username, languageId, etc.). The variables of the request are available in the object “reqParams” (e.g.: reqParams.applicationId etc)

The following table reports all available variables:

Variable nameTypeExample
USERNAMEStringusername of the current logged user
LANGUAGE_IDStringlanguage identifier, e.g. IT, EN, …
COMPANY_IDStringidentifier of the data partition in use; 4WS.Platform supports multiple company partitions (multi-tenancy), where each partition is identified by the company id.
SITE_IDNumbercode used to filter data
TODAYStringcurrent date
MONTHNumberMonth of the year, expressed as0..11 (jan..dec)
DAYNumberDay of the month
DOWNumberday of the week, expressed as 0..6 (sun-sat)
NOWDateCurrent date+time
APPLICATION_IDStringapplication identifier