Simplicty and flexibility!


Unique Form


Started by Karen Miller
Search
You will need to Sign In to be able to add or comment on the forum!

Unique Form

I'm recreating a form from 6.52 to 8.5.  My new form appears to have the same settings as the old form.  An employee can have no more than one of these forms for each school year (fields: SS# and school year are both unique, indexed and required).  Any thoughts?


Written by Karen Miller 11/04/17 at 15:39:33 Dataease [{8}]FIVE

Re:Unique Form

It is a little unclear what the problem is but in general the situation is as follows:

In a DataEase form the combination of unique fields are what the unique constraint means, so if you have more than one fields that is flagged Unique your record gets less unique rather than more.

One should try to avoid having more than one unique field in a form, so if your uniqueness is built on more than one field you should make a seperate field that concatenate the previous omens and make this unique.


Written by DataEase 11/04/17 at 15:44:30 Dataease [{8}]FIVE

Re:Re:Unique Form

That was it!  I removed the uniqueness from SS#.  Thank you


Written by Karen Miller 11/04/17 at 15:55:06 Dataease [{8}]FIVE

Re:Re:Re:Unique Form

Karen, the way you had it originally is the way you want it, with one performance caveat.

If you take uniqueness off SS#, you will only be able to add one record per school year no matter who it applies to (unless there are other things going on here that you've not described).

you need both SS# and Year as unique to allow one year per person. 

Better, you should have a third field SS#_Year that is derived:

if ( SS# = blank or Year = blank , blank , concat ( SS# , "|" , Year ) ) 

and make this the one and only unique field.

The performance caveat is that it takes more processing to check two unique fields to see if the combination of values is unique, although on a small dataset and a modern PC you won't notice this. 

[Unless DE 8 implements compound indices, in which case there should be a different way to implement the same thing]


Written by Adrian Jones 24/04/17 at 13:21:51 Dataease [{8}]FIVE
DG3_ForumList