Get the string name of attributes and association in a Java / Javascript action similar to the entity parameter - Mendix Forum

Get the string name of attributes and association in a Java / Javascript action similar to the entity parameter

5

It would be useful if you could select an attribute and an association similarly to selecting an entity in a java action. This way we could get the name of the attribute or association as a string and use it in things like OQL queries and after startup creation flows (like creating email tokens) and creating generic Java actions. Currently all this is pretty error prone as most Mendix developers are used to freely edit attribute names and doing so will not result in any errors when a string representation is used. 

asked
2 answers

Related ideas:
https://forum.mendix.com/link/space/java-actions/ideas/2401

https://forum.mendix.com/link/space/java-actions/ideas/2109
https://forum.mendix.com/link/space/java-actions/ideas/691

Created

Agreed.

Current workaround: have a java action return YourEntity.MemberNames.YourAttributeOrAssociation.toString() instead of using hardcoded strings.

At least this will throw errors when compiling a package after relevant domain model changes, so you can fix them in time, instead of waiting for your microflows to fail after the app was deployed.

Created