Expression Attributes in Entities - Mendix Forum

Expression Attributes in Entities

2

In an Entity it is possible to have stored attributes and attributes which can be calculated via a microflow.

For me it would be very helpfull if it would be possible to have an attibute which gets its value via an expression. It should only be possible to use the attributes of the entity in the expression and of course (string) functions etc. With this, it is easily possible for example to define a DisplayName of an Entity which can be used everywhere in the application or to calculate a sum of some integer attributes. Evaluatin the expression should not lead to a round trip to the backend.

asked
3 answers

It is common to have a string representation of a date field in an entity. This might be done to simplify sorting in grids or text searching that involves dates. The result is that you must pepper the application with logic to calculate this anywhere the value may change.

Having this idea implemented would make that effort unnecessary. That would be a good thing.

Created

The difference would hopefully be better performance. The calculated attributes who are populated via a microflow alwasy need a call to the server. With an expression, that would not be needed. Such expressions you could also use in nanoflows.

Created

What would be the difference between your suggestion and using a calculated attribute microflow where you have the expression as an end event? Aside from the client side part of it I suppose.

Somewhere you would have to model what this expression contains, and not all values might be available in the client.

Created