I think I am still doing something wrong. When I add a record to the child the FK is not updated.Using the SF sample database, I created a form with two BOs (Customers and CustomerNotes). CustomersBO has a FillAll() which simply reads all records. When I run the following code it throws an error during the save.
customersBO1.RegisterForeignKey(customerNotesBO1, "cn_cust_pk");
customersBO1.FillAll();
customersBO1.MoveFirst();
MessageBox.Show(customersBO1.cust_pk.ToString());
customerNotesBO1.Add();
customerNotesBO1.cn_Version = 99;
customerNotesBO1.Save();
The customersBO1 definitely has a current record yet the save throws the following error:-
"The INSERT statement conflicted with the FOREIGN KEY constraint "Fk_Customers_Notes". The conflict occurred in database "StrataFrameSample", table "dbo.Customers", column 'cust_pk'.
The statement has been terminated."
Am I doing something wrong?
Thanks in advance,
Aaron