Friday, March 22, 2013

Mandatory fields and table hierarchies

If you have a table hierarchy, and there is a mandatory field in the child table, your data may become inconsistent in some cases.

For example, there are 2 tables (TestDog extends TestAnimal):

 
 
Let's make TestDog.OwnerName field mandatory and create a record in TestDog with blank OwnerName:
 
 
A warning is shown, which is correct. Now let's close the form. Normally, you would expect a dialog "Changes have been made in the form. Save changes? Yes/No". But in our case, the records are saved in both tables, with a blank mandatory field in TestDog.