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
Miscellaneous
Thread ID:
00187768
Message ID:
00188010
Views:
20
>Bret-
>I guess I'm asking a more basic question than that. If you are using parameterized views, why are you looping through cursors to tableupdate them? Why aren't you table updating the parameterized views? Or are you?
>
>When you add do you add into the _table_ or the _view_? If you are using views then *generally* you don't also want to be manipulating tables.

The code is very generic, designed to work in all kinds of forms without making assumptions about what kinds of cursors are in use. Looping through an array created by AUSED() won't try to get at underlying tables if views are in use, I'm pretty sure.

I realized that I already had properties in my framework that store the names of the parent and child cursors. I was using them to insert foreign keys and other stuff. I should check for NOT EMPTY(THIS.parentcursor) and update that cursor and then update the child cursor if that property of the framework object is also NOT EMPTY. Based on what is already written, that is probably the way for me to go.

In many cases, it is probably better to make them create a parent record, save it, and only then start adding children. That is what many of my forms impose on my users. It is in the case of a form whose parent table is related many-many with another important table that it is often desirable to create some children immediately. The most obvious example of what I mean is the order-items example I mentioned earlier in this thread. I would be interested to know how other people make that work.
Previous
Reply
Map
View

Click here to load this message in the networking platform