Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Updating new parent and child records in framework
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Updating new parent and child records in framework
Miscellaneous
Thread ID:
00187768
Message ID:
00187768
Views:
53
My Save button code loops through the open cursors in AUSED() and does a TableUpdate() on each. This code originally comes from the txtbtns class of WIZSTYLE.VCX. The problem is that when both a parent and a child record have been added, a "trigger failed" error can occur, probably because the child happens to get updated before the parent, and there is no corresponding parent record yet. I need a generic and flexible means for the framework code to determine which cursors should be updated first. I usually have parameterized views for the child grid and therefore no relation in the Form.DataEnvironment.

I thought of adding an array property to the container that has all this method code. This property would contain the cursors that needed to be updated when the user clicks Save, in the correct order. Each instance of the control would have a hook that would initialize the array with the correct cursor names for that form. I would have to go back and edit each of my forms (not so many, really) to fill in these table and view names. Is this the right way to do it, or is there a better way?
Next
Reply
Map
View

Click here to load this message in the networking platform