Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Clistobjedit - Add parent, add children, no foreign key?
Message
De
29/10/2003 12:46:48
Jason Mesches
Ocean Systems Engineering Corporation
Carlsbad, Californie, États-Unis
 
 
À
29/10/2003 12:10:10
Scott Malinowski
Arizona Fox Software LLC
Arizona, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
The Mere Mortals Framework
Divers
Thread ID:
00844108
Message ID:
00844167
Vues:
25
Not until the parent's Save() will the PK make its way back to the table. That's why you would want use the parent's view and not the table, but you're doing that with the GetAlias() call. The view should have its PK value set from NewID() during the BizObj.New()

I think that's the issue here. You're not getting the parent's PK value populated in the view.

Check your parent BizObj's data environment. Make sure the lAutoGeneratePrimaryKey flag is set .T. (should be .T. by default)

You can also try stepping through BizObj.OnNew() -- that's where the PK is set.

Hope that helps,
---J

>Hey Jason,
>
>Yes, here's the code:
>LOCAL lcChildAlias, loParentObj, liFKValue, lcParentAlias
>
>loParentObj = ThisForm.oCallingForm.RefBizObj.Get('vehiclemakes1')
>lcParentAlias = loParentObj.GetAlias()
>
>liFKValue = EVAL(lcParentAlias + '.vmid')
>lcChildAlias = ThisForm.oCallingFormListObj.GetAlias()
>
>REPLACE vmfk WITH liFKValue IN (lcChildAlias)
>
>During debugging, I browse the parent view and all the added records show zero in the primary key field. Seems that they have NOT updated the parent table yet?
>
>Thanks again!
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform