Turns out the query for the child bizobj was the problem:
SELECT *,TableB.CategoryCode FROM TableA JOIN TableB ON ...
This brings in all of the TableB fields in (table b has a PK field), I changed the query to
SELECT TableA.*,TableB.CategoryCode FROM TableA JOIN TableB ON ...
And the problem went away.
>Hi I have a parent->child form.
>
>Here's the data:
>
>
>Parent
>======
>
>id Name
>--- ----
>P1 Rick
>P2 Chris
>
>Child
>=====
>
>ParentId CategoryCode Sequence
>-------- ------------ --------
>P1 C1 1
>P1 C1 2
>P1 C2 3
>P2 C3 4
>
>
>
>The child table doesnt have a primary key. In addition, as you can see, the child table has duplicate category codes within the same parent id.
>
>In the child bizobj, I set PrimaryKey to "" (since there's no PK). The child data is not going to be modified. I register the child bizobj as a child of the parent. When I navigate to parent P1, I get the following error "Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints."
>
>The data is sql server, there is a non-unique index on the ParentId field.
>
>I have tried setting
>
>this.PrimaryKeys = new string[] {"ParentId", "CategoryCode","Sequence"};
>
>figuring this might work but I get the same error -
>
>Any ideas?
>TIA,