Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Clistobjedit - Add parent, add children, no foreign key?
Message
From
29/10/2003 12:46:48
Jason Mesches
Ocean Systems Engineering Corporation
Carlsbad, California, United States
 
 
To
29/10/2003 12:10:10
Scott Malinowski
Arizona Fox Software LLC
Arizona, United States
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Miscellaneous
Thread ID:
00844108
Message ID:
00844167
Views:
24
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!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform