Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Accessing the Primary Key
Message
From
12/12/2001 11:03:17
 
 
To
10/12/2001 17:45:12
Jason Mesches
Ocean Systems Engineering Corporation
Carlsbad, California, United States
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Miscellaneous
Thread ID:
00591952
Message ID:
00593284
Views:
28
Jason,

Thanks for the feedback. I actually figured out my problem. I had the autogenerateprimarykey to .t. - thanks for pointing it out to me though - I think I was just lucky to have somehow wet it to true! The problem was with my newid() function.

>How are you creating the new record? If you're using BizObj.New(), and you kept the default value = .T. of cDynamicCursor.lAutoGeneratePrimaryKey (in cDataEnv.vcx) the value is "pre-fetched" into the new view record. This allows you to do exactly what you're referring to.
>
>If you see the ID in the view, but the table ends up with a different value (usually 1 greater than the view) make sure the PK field is updateable in the view.
>
>You *definitely* don't want to rely on a requery to populate your view, as I'm sure you're discovering!
>
>Hope that helps.
>---J
>
>>I have a view with a primary key field, which is set to autogenerate in the business object. However, after save is called, there is no key in the key field of the view. This prevents me from calling other views based on this key field.
>>
>>How can I access the auto-generated value? If the bizobj is set to autogenerate primary keys, shouldn't it be placed in the view?
>>
>>At this point, I'm requerying the whole view, which has too much of a lag.
>>
>>Thanks,
>>
>>David
Previous
Reply
Map
View

Click here to load this message in the networking platform