I had this same error message; it looks to have been caused by incorrect [PXParent] attributes on child tables. They were in the form:
[PXParent(typeof(SelectFrom<Parent>,Where<Parent.Field,IsEqual<Parent.Field.FromCurrent>>>)]
But needed to be
[PXParent(typeof(SelectFrom<Parent>,Where<Parent.Field.IsEqual<Child.Field.FromCurrent>>>)]
And make sure that if you have two or more fields in the child defining the link to the parent, then use them both/all in the one PXParent:
[PXParent(typeof(SelectFrom<Parent>,Where<Parent.Field1.IsEqual<Child.Field1.FromCurrent»
.And<Parent.Field2.IsEqual<Child.Field2.FromCurrent>>>>)]
Otherwise you’ll find the delete cascades to any record that has (Field1 = parent OR Field2 = parent).
Note there’s also the LeaveChildren flag if you don’t want the parent delete to cascade to that child table.