Testing for dataobject validity in adding and editing