Stephan Bruijnis .dev

Useful JavaScript functions

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).

This list is not complete, and these functions are not documented by Mendix. Which means support is limited.

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.


Constants #

Returns array with objects containing the constants exposed to client.

// or if you are on a newer Mx version (> 9.x )

isDevModeEnabled #

Returns boolean.


Metadata #

Returns array with objects containing all entities and attributes available to the current user1.


Similar to the mx.meta.getMap();

Roles #

Returns array of user roles of current user.


User #

Returns object current user (system.user or it’s specialization administration.account, company.employee) with attributes and it’s values.


sessionObjectId #

Returns integer sessionObjectId


Demo Users #

Returns an array with objects containing the demo users; username, password and roles.


mx.meta.getMap() #

getMap #

Returns array with objects containing all entities and attributes available to the user1.


Similar to the mx.session.getConfig(“metadata”)

  1. This feature is often used to do a scripted security scan. Can also be abused to leak data and I hope Mendix removes these features from the client api to make it a bit harder to detect for bad actors which entities are unprotected. ↩︎