Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SetPrimaryBizObj does not
Message
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Miscellaneous
Thread ID:
00517166
Message ID:
00518305
Views:
14
Thanks Kevin.

I understand but the method name is confusing. SetPrimaryBizObj (The Dev Guide says, "Makes the passed business object the primary business object.") implies that the passed object will be made the primary business object regardless of the initial design. It bit me when I had to change the initial design primary after the form instantiated. After a call to a find form the initial design primary (lPrimaryBizObj set to .T.) bizobj became the primary form bizobj instead of the one specified with the SetPrimaryBizObj before the call. I traced reason down to the FindProcess (see below)


BizObjA lPrimaryBizObj set to .T.
BizObjX lPrimaryBizObj set to .F.
oBizObj = BizObjA
oPrimaryBizObj = BizObjA

SetPrimaryBizObj(BizObjX)

BizObjA lPrimaryBizObj set to .T.
BizObjX lPrimaryBizObj set to .F.
oBizObj = BizObjX
oPrimaryBizObj = BizObjA
.
.
.
FindProcess
.
.
.
*--------------------------------------------
*--- If the form's primary business object
*--- is not currently set as primary,
*--- make it so.
*--------------------------------------------
IF NOT ThisForm.oBizObj.lPrimaryBizObj
ThisForm.SetPrimaryBizObj(ThisForm.oPrimaryBizObj)
ENDIF
.
.
.

FindProcess resets the PrimaryBizObj based on the lPrimaryBizObj Flag. Consequently, (in my case) data manipulation buttons operate on the wrong BizObj.

I think there is one (two?) other location where the LPrimaryBizObj flag plays a role but do not have it at the moment.

Bob
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform