Servoy Based Validation/Verification

Hi,

What I can see in Servoy, that is after reading the database schema, the field attached to will blindly inherit the database field properties, thats cool, but it will be great to have an intermediate layer where Servoy can do more Validation/Verification before going to the database.

Simple Example:
if I have a database field
name varchar(50) NULL

In one form I want this field to be Optional, so no problem here.
In the second form I want this field to be be required, so I have to write a code.
in fact in the second option it will be great to mark the field property called required(Yes/No).

Plus, Servoy should have a set of pre-defined error messages, saying this field is required, not just “cannot save form data”

Mohamad Sibai

Hi Mohamad

As far as I can tell, if you define an attribute of an entity (implemented column in a table) as mandatory, it IS generally mandatory for all input. In the database design you set all requirements what attributes make up at least for the given entity and are able to also specify some optional attributes (some literatue still says that should be avoided and associated with an entity where it’s a mandatory attribute).
You should not try to change the database definition in an intermediate layer (as you call it). The database has to model the relevant real world part for your problem and the forms are just views/input system to it.

Just my 2 cents :-) Best regards, Robert

MSibai:
Hi,

What I can see in Servoy, that is after reading the database schema, the field attached to will blindly inherit the database field properties, thats cool, but it will be great to have an intermediate layer where Servoy can do more Validation/Verification before going to the database.

Simple Example:
if I have a database field
name varchar(50) NULL

In one form I want this field to be Optional, so no problem here.
In the second form I want this field to be be required, so I have to write a code.
in fact in the second option it will be great to mark the field property called required(Yes/No).

Plus, Servoy should have a set of pre-defined error messages, saying this field is required, not just “cannot save form data”

Mohamad Sibai

Thanks Robert,

Infact I do not want Servoy to change the database properties …
All what I want is to attach a property variable to every editable field (on the code layer) and upon save a function will check if that field is required and contains no value, an error will be prompt.

now this is regardless wither it is mandatory or not…

I other scenario, I have a table for user registration with two levels free and paid. The table contains Credit card information which are mandatory is the user tried to register as paid service.
I know that there is a work around that I can develop a quick function on save …
but I need two different forms for each level …

this is a simple scenario , and I can survive without having this feature, but it will be great to have such feature …

This is too close to the field formatting option … for example Servoy does not rely on the database to enforce certain format of the date .

As far as I know, column/table validation is comming in Servoy 3.2

Correct, it also will report with distinct error codes into the solution exception handler