Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Behavior - New Child on New Parent
Message
De
09/07/2003 11:40:43
Jason Mesches
Ocean Systems Engineering Corporation
Carlsbad, Californie, États-Unis
 
 
À
09/07/2003 00:01:45
Robert Jewett
Q Technology Consulting
Tyler, Texas, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
The Mere Mortals Framework
Divers
Thread ID:
00808305
Message ID:
00808529
Vues:
8
Robert,

Have you stepped through the code to be sure New() isn't firing at all on the child? The reason I ask is that I remember there used to be an issue with setting the child's nRequery property to 1, if it's also set to create a new record when the parent adds a new record. Turns out that immediately after adding the new child record, the requery would trash it. We ended up adding code to test for IsNew() in the requery and it seemed to work.

As far as the save not trickling down to the child, I would suggest adding a SET STEP ON to in front of the following code in kBizObj.Save()
*--------------------------------------------------
*-- If the parent was saved successfully, cascade
*-- the Save() message to child objects.
*--------------------------------------------------
Hope that helps,
---J

>I am trying to reconcile an observed behavior with what I am trying to accomplish. I am using a cNoListMaintForm, on which I have a parent object, then on another page frame of same form, have a child object. The parent object is correctly specified in the builder for the child object, along with the check box New Child on New Parent. I have code in the postInitHook, preRequeryHook, and preSaveHook of the child to properly set the view parameter to properly requery the child. Requery for the child is set to 1 - Requery if Parent Changes. If I manually add records to the child table, they are displayed properly on the tab, leading me to believe the requery portions are operating consistent with expectations.
>
>Now, on to the problem/observance.
>
>I would have expected by virtue of the New Child on New Parent setting that when I add a new record via the parent object (selecting File/New), that a new record would automatically be added to the child table via its object. This does not appear to be the case. I get a new record in the parent, but not in the child. Also, if I make a change in the child record, then change to the parent tab before clicking save, and THEN click save, it is not saving the child record even though Save Child on Save Parent is set. I am not sure if I am missing a configuration step, or just misunderstanding how this should be working.
>
>I have selected this approach (rather than AutoPrimaryBizObj) because I did not want to write code to prevent a user from selecting the second or third tab and clicking new before a parent record was added or selected.
>
>I would greatly appreciate any enlightenment that might be offered.
>
>
>Robert
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform