Useful JavaScript functions in Mendix client API
JavaScript functions that are available in the Mendix client API. These can be used in the browser console or in JavaScript actions (nanoflows).
mx.session.getConfig()
Locale
Returns object with the user locale info (language code, first day of the week, date and number patterns etc.) of the current user.
mx.session.getConfig("locale");
Constants
Returns array with objects containing the constants exposed to client.
mx.session.getConfig("constants");
// or if you are on a newer Mx version (> 9.x )
mx.session.getConstants();
isDevModeEnabled
Returns boolean.
mx.session.getConfig("isDevModeEnabled");
Metadata
Returns array with objects containing all entities and attributes available to the current user1.
mx.session.getConfig("metadata");
Similar to the mx.meta.getMap();
Roles
Returns array of user roles of current user.
mx.session.getConfig("roles");
User
Returns object current user (system.user or it’s specialization administration.account, company.employee) with attributes and it’s values.
mx.session.getConfig("user");
sessionObjectId
Returns integer sessionObjectId
mx.session.getConfig("sessionObjectId");
Demo Users
Returns an array with objects containing the demo users; username, password and roles.
mx.session.getConfig("demoUsers");
mx.meta.getMap()
getMap
Returns array with objects containing all entities and attributes available to the user1.
mx.meta.getMap();
Similar to the mx.session.getConfig(“metadata”)