Been using NTWS for over a decade, but almost always for API stuff, so I can never seem to remember the basics of the UI side of things.
I have a browse for customers. The customer update form has browses for child tables. When I insert a child, I expect the parent key to be set properly in the child form, but it isnt. In fact, the GV or GSV values arent correct (they're "stale") so I cant use those.
Example 23 looks like the closest fit, but it isnt really the same thing. Ex 23 uses the advanced tab's "Prime key from parent table" feature, but that doesnt seem to work when going from browse to form to form.
Even when I use "Prime Key from parent table" and have it set to the proper parent table, the value that gets set for the child's FK (parent) value is stale unless i go into the parent update form twice.
Here's a (hopefully) more descriptive version of what I am seeing:
If I browse to customer 1, then open the customer update form for customer 1, then close the update form, then browse to customer 2, then open customer update form for customer 2, then open the update form for customerchild as an insert - customer ID 1 is on the customerchild form. The parent child relationship is defined in the DCT.
If I browse to customer 1, browse to customer 2, open customer update form for customer 2, close the update form, then reopen the customer update form for customer 2, then open the customerchild form for insert, THEN customer ID 2 is on the customerchild form. Obviously, this is not correct, nor is it something youd expect a customer to do.
I fixed it by creating a uniquely named session variable when the parent form opens (set to the parent PKID). That SV gets used in the initform routine of the form procedure to prime the child's PK value (the parent's PKID).
Because of all the fun I had with this, Im wondering if there's a better way to solve the parent browse-parent-update-child-update scenario.