
To access the current user contact, and other system variables from a Creatio Freedom UI page, there is a simple, built-in module named “SysValuesService” that you can use, available in the new Creatio DevKit SDK.
To use this devkit, you’ll need to add “@creatio-devkit/common” to the modules list of your page. This will look like this (note the “@creatio-devkit/common” in the square brackets and the sdk without quotes in the parenthesis):
define("UsrMyCustomEntity_FormPage", /**SCHEMA_DEPS*/["@creatio-devkit/common"] /**SCHEMA_DEPS*/, function/**SCHEMA_ARGS*/(sdk)/**SCHEMA_ARGS*/ { return { // ... the rest of the page here }; });
Now, with that module available, you can access things in the SDK, such as the SysValuesService. You’ll need to create an instance, and can then use it to read system values, such as the current user contact.
const sysValuesService = new sdk.SysValuesService(); // load the system values const sysValues = await sysValuesService.loadSysValues(); // now get the current user contact const currentUserContact = sysValues.userContact;
The available system values you can get using the SysValuesService are:
- maintainer – maintainer (Lookup value)
- moneyDisplayPrecision – precision used for displaying money (Number)
- maxEntitySchemaNameLength – max length of entity schema (Number)
- workspace – workplace info (Lookup value)
- userAccount – user info (Lookup value)
- userTimezoneCode – code of user’s timezone (String)
- userTimezoneOffset – offset for user timezone (Number)
- userContact – user contact info (Lookup value)
- primaryLanguage – primary language (Lookup value)
- primaryCulture – primary culture (Lookup value)
- userCulture – user culture (Lookup value)
Subscribe To Our Newsletter
Join our mailing list to receive the latest Infor CRM (Saleslogix) and Creatio (bpm'online) news and product updates!
You have Successfully Subscribed!