Otis wrote:
The SubprojectCustomerEntity.OnEntityAfterSave routine will be called when Customer and when subproject are saved. In there, the FK's in SubprojectCustomerEntity are set with the PK values of Customer and subproject.
Could you set a breakpoint at the first line in that routine and see if it actually gets called and if the FK fields are indeed set to a value?
The customer is not being saved as there are no changes to the customer. Not sure if this makes a difference, but I thought I'd mention it.
OnEntitySave is being hit, with the sender being the SubprojectEntity (i.e the immediate parent). entitySyncInfos has only one item, which strikes me a strange, although I can't inspect the contents to find out what they are.
I thought, because the function uses a name compare that setting the SubprojectCustomer.Subproject to a _My_SubprojectEntity parent may have been causing the problem, but that doesn't appear to be the case, as I changed it to a SubprojectEntity and I still have the same issue.