Nerissa,
>Is this method intentionally coded to expect only a boolean returned value in line 46 which says "IF NOT llRetVal"? I tried to send a "Delete" message to the child business object using this method from the parent business object kbizobj.delete(). But delete() is returning a numeric value which causes a "Data type mismatch" error.
I've been thinking this one through with another Mere Mortals developer via private e-mail. I originally designed the method to expect a boolean return value...this allows any child object to return a .F. in order to stop any further processing. However, I'm thinking of modifying it to the following code which checks the type of the return value before checking its value. How would this work for you?
LPARAMETERS tcMessage, tuParm
LOCAL lnObjCount, lnCount, loChildBizObj, luRetVal, lcMessageCall
IF TYPE("This.RefBizObj") == "O"
lnObjCount = This.RefBizObj.GetObjectCount()
IF PCOUNT() = 1
lcMessageCall = "loChildBizObj."+tcMessage+"()"
ELSE
lcMessageCall = "loChildBizObj."+tcMessage+"(tuParm)"
ENDIF
FOR lnCount = 1 TO lnObjCount
loChildBizObj = This.RefBizObj.Get(lnCount)
IF PEMSTATUS(loChildBizObj, tcMessage, 5)
luRetVal = &lcMessageCall
IF VARTYPE(luRetVal) == "L" AND NOT luRetVal
EXIT
ENDIF
ENDIF
ENDFOR
ENDIF
RETURN luRetVal
Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com