Updating grand child when saving parent (RegisterForeignKey)


Author
Message
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi All,

I am having problem updating a grand child record when saving the parent.  I attached a small VB sample project using the SF Sample tables Customers, Orders and OrderItems.

I created the main form frmCustomers which is used to add Customer, then the orders are added via a ChildFormDialog frmOrders and the OrderItems are added programmatically, and here is the problem, when clicking the Save button in frmCustomers, the Customers and Orders records are saved and the or_Cust_PK is updated properly, but the record for OrderItems is not saved and I believe the problem is that the field orit_or_pk is not being updated with its parent field value.

To test do the following:

  1. Add a new record in frmCustomers form (I added default values for all adding)
  2. Add a new Order from the Order's listview toolbar.
  3. Add a new Order Item from the frmOrders form.  (This will add a record programmatically with a orit_Prod_PK = 235)
  4. Click OK in frmOrders form.
  5. Click the Save button in the frmCustomers toolbar.
  6. In the Orders listview, Edit the Test PO record.
  7. Notice that there is no Order Item record created, and I have not been able to find out why.

Notice that all I am trying to do here is to implement the logic of saving all BOs in at a single point, in this case the frmCustomers form's Save button.

Edhy Rijo

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search