Allow validation rules to apply to multiple attributes and/or give entitys index a checkbox unique. - Mendix Forum

Allow validation rules to apply to multiple attributes and/or give entitys index a checkbox unique.

11

It is currently not possible to make an entities multiple-attribute index unique.

You can enforce uniqueness in other ways, by adding a BCo_Entity_PreventDuplicates to the entity combined with OCh_Entity_Attribute added everywhere you can change one of the attributes that are part of the index but that is cumbersome and errorprone.

Another option: If the index has only one attribute you can create a validation rule with the boolean 'unique' set to true. But that is not possible when the index has multiple attributes.

 

Therefor: Allow validation rules to apply to multiple attributes and/or give entity's index a checkbox 'unique'.

asked
3 answers

It is rediculous you cannot have a list of unique keys which is industry standard i.e. DB2.  Mendix is suppose to be a relational database.  Also agree with Tim, duplicate/not normalized data which wastes DASD.

Created

This is a good idea.
This is a very convenient and commonly used function.
I'm surprised that there are only a few people voted.

Created

An alternative is to add an extra attribute to the entity and filling this BCo_Indexattribute with the concatenated values of Postalcode, Housenumber and HousenumberExtension.

Disadvantage of this method is the creation of redundant data.

Created