Field Validation not working

Subhransu

Member
Hi,
I tried putting a simple validation in "Field Validation Dialog Box" in DB Dictionary for a perticular field.

e.g. for CustNum : custnum > 0

But it does not work as expected when inserting data using CREATE and ASSIGN statements. It seems the validation option is not working.

Please let me know what must be the reason behind this.

Thanks.
Subhransu
 

TomBascom

Curmudgeon
You should not use dictionary validation. Ever. You will always end up regretting it.

"Validation" is one of those features that "makes a good demo". It was stunning in 1988. But that was before there was widespread recognition that mixing business logic, UI and data access is a Bad Thing.
 

Cringer

ProgressTalk.com Moderator
Staff member
Just stick all your validation in database triggers. That will solve all your problems. Not :(
 

TomBascom

Curmudgeon
That's true, triggers would be equally bad. If not worse.

Ideally the validation logic should be in a stand-alone procedure of some kind (it could be a library of internal procedures or a class library). If done right this code would contain no user-interface elements and thus could be run from any part of a multi-tier architecture. If you wanted to go to extremes you could even de-couple it from data access.
 

GregTomkins

Active Member
The last time you (Tom) said that, you said 1985. I know this because it's pinned to my cube wall, along with a few other classic programming quotes.
 
Top