General information
Category:
The Mere Mortals Framework
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only