StrataFrame Forum

Exception when saving a parent/child with more than one field in primary key

http://forum.strataframe.net/Topic3908.aspx

By fparker - 10/27/2006

I have a screen with two business objects on it in a parent/child relationship.  The parent object has two fields in its primary key and the child has three.  The PrimaryKeyIsAutoIncremented property is set to false for both objects.  Whenever I try to save, the BusinessLayer.PushDataToChildren method throws a BusisnessLayerException.  The description is "The PrimaryKeyIsAutoIncremented property on business object [] cannot be True because the PrimaryKeyField property contains more than one field.".  I took a look at this method and it looks to me like the problem is that the check that determines whether or not this exception should be thrown looks only at the number of fields in the primary key and ignores the state of the PrimaryKeyIsAutoIncremented property. 

Fran Parker.

MaxQ Technologies, Inc.

By StrataFrame Team - 10/27/2006

Yes, that was a bug, the Save() method was properly checking the PrimaryKeyIsAutoIncremented property before calling the PushDataToChildren() method, however, the SaveByForm was not checking the same value before calling it.

The resolution will be in the build we are releasing later today.  Thanks.