Skip to main content

Inside a client-side Javascript action

These predefined variables are automatically set when a user is logging on the User Interface and are defined at user level.

They represent Javascript objects you can use and refer in any part of the User Interface, through client-side javascript actions.

Variable NameTypeExample
userRolesArrayif (userRoles.indexOf(“1”)!=-1) {// do something}
languageIdStringlanguage identifier, e.g. IT, EN, ...
appVersionString4WS.Platform version, showsed in the bottom bar
contextPathStringweb application context path; e.g. “/platform”
applicationIdStringapplication identifier
userDescriptionStringuser description, defined in the user detail form
buttonsAuthHash tablecollection of couples related to the functionalies enabled for the current logged user.Each functionality is identified by the “function id”.Arrays contains 3 boolean values, related to the authorizations “can insert”, “can edit”, “can delete”.Authorizations are defined through the “Roles” functionality.Example:buttonsAuth["contratto.gridPanel319"] = [true,true,true];
companyIdStringidentifier of the data partition in use; 4WS.Platform supports multiple company partitions (multi-tenancy), where each partition is identified by the company id.
usernameStringusername of the current logged user
applUserParscollection of couplesrelated to tuser parameters, defined through the user detail form.