Overhaul the current Validation-options for Objects and their attributes - Mendix Forum

Overhaul the current Validation-options for Objects and their attributes


Validation of inputdata is now scattered over three locations and has it's limitations and drawbacks:

  1. The Validationrules of an entity.
  2. The BCo_<entityname>_Validation microflows for validation of the entire object.
  3. The Validation-properties of frontend data-fields

The limitations and drawbacks:

The entity  ‘Validation rules’ only apply to each attribute by itself. Yet it is in a tab ‘Validation rules’ on the entity-properties, suggesting that they are object validations. Instead they are attribute validations and are better placed under tab 'Attributes’ in their own attribute.
Also the validation options are quite limited and can only check their own value, without taking other values into account (for instance: if attributeA has a value, than attributeB also has to have a value)

Objectvalidation is currently usually done in a microflow called BCo_<entityname>_Validation. This has drawbacks:


Frontend attribute-elements have their own validations having the same limitations as 1). Also you have to set them per screen,which is laborious and is making it easy to have different validations at different screens, which is odd.


- Move the current entities validation rules to the tab 'Attributes’ and extend their validation options

- Create a new documenttype called 'Objectvalidation’, which will be quite similar to a rule (meaning: no datachanges allowed), but:

- Make the frontend's attribute-elements use the entity’s validations and make them by default show the validation warnings only for the changed elements.


Once this is in place, validations will be easier to maintain and only have one place in which they are defined: the entity.

0 answers