Provide easy way to alphabetize attribute names in an entity - Mendix Forum

Provide easy way to alphabetize attribute names in an entity

4

Sometimes, I begin working (and doing some cleanup and refactoring) on a Mendix app that I didn’t create.  In these cases, I would like to alphabetize attribute names within an entity.  It is not uncommon for me to see an entity with 75 or 100 attributes.  I know that I can alphabetize these manually, but that is very time consuming.  Maybe there could be a button in the entity dialog box to alphabetize attributes.

asked
2 answers

The Model SDK could do this.

Would be nice plugin when Studio Extensions https://forum.mendix.com/link/ideas/2003 are implemented

Created

You should be able to use the Model SDK to do this. You can scan each entity in the domain model retrieve the entities which are in an array format. You can then detach an item from the array and add it back in. The Array controls the order of the attributes. So you could do a simple order function on the array based on the name of the attribute. Then commit those changes back.

Created