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?
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.
That was it! I removed the uniqueness from SS#. Thank you
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]