Geof,
Thanks for the response, but it doesn't solve my problem. Setting the bo properties you suggest does yield new child records when a new parent is created, but that's the incorrect behavior for my usage. When creating a new parent, the user may choose not to enter data in any one or two of the children leaving a blank record that would then be saved into the child table...not good. Also, if editing an existing parent record, the user may decide he wants to add data to a child that had no records entered at creation. So really the problem becomes: When adding a record to a view (using the bizobj.new() method) that heretofore had no records in it, how does one make the grid recognize it now has something to display and should allow user entry?
Virgil
<i><font color="#663300">Hi Virgil, You could check that the subclassed Bizobj Properties LNewChildOnNew and LNewRecordOnNewPArent have been set to .T.
Determine the behaviour required, then set the properties like this: (As we are only looking up or down one level from each bizobj in turn we don't need to consider the case of Grandparents when setting those properties.)
Go through these questions and actions for each bizobj in turn
If this is a child bizobj if you want a new record generated for each new parent LNewRcordOnNewPArent = .T. else LNewRecordOnNewPArent = .F. endif endif
if this is a parent bizobj if you want at least one child bizobj ; to create a new record on creating ; a new parent record LNewChildOnNew = .T. else LNewChildOnNew = .F. endif endif <i><font color="#663300">After much tinkering, hair pulling and finally removal of self-induced BUGS, I managed to get Geof Whitham's 1 to many example to work. Many thanks to Geof for the example; I believe I'm beginning to understand how this mess goes together :).
Now for my real-world problem: The form I'm trying to create has a parent bo, three child sibling bo's, and a grandchild. I've got them all syncing up quite nicely during edits as long as there are records existing in the child views, but if a child happens to be empty, I am unable to add a record. CB appears to append a record to the view as evidenced by a request to save when closing the form, but I am unable to enter the grid and type in the data. Any idea what's happening and how I can remedy?
</font></i>
</font></i>
©2001 Virgil Bevans |