Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
'New child on new parent' not working
Message
From
14/05/2002 13:11:58
Bill Breay
Custom Business Software
Arvada, Colorado, United States
 
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Miscellaneous
Thread ID:
00655885
Message ID:
00656279
Views:
19
I have stepped thru the new() code in the situation where the 'new child on new parent' has been checked on the child bizobj.

The code shown below (from the new() method) does not process because the type for This.RefBizobj = 'U'.

IF lnRetVal = FILE_OK
IF This.lCascadeMessages AND TYPE("This.RefBizObj") == "O"
LOCAL lnCount, lnObjCount, loChildBizObj
lnObjCount = This.RefBizObj.GetObjectCount()

FOR lnCount = 1 TO lnObjCount
*-----------------------------------------------------
*-- The new record was added to the parent without
*-- incident, if specified to do so, refresh the child
*-- business objects' data environment.
*-----------------------------------------------------
loChildBizObj = This.RefBizObj.Get(lnCount)

IF loChildBizObj.lRequeryChildOnNewParent
llIsNewAndEmpty = loChildBizObj.Requery()
ENDIF

*-----------------------------------------------------------------
*-- If specified, insert a blank business object on the child side.
*-- It's a good idea to set up the child business rules so that if
*-- user tries to save the parent with a blank record on the child
*-- side, the child's insert trigger will fail, therefore preventing
*-- orphaned parents from being created. The child business object
*-- should be responsible for adding a blank record when the
*-- user attempts to delete the last child record.
*-----------------------------------------------------------------
IF loChildBizObj.lNewChildOnNewParent
loChildBizObj.New()
ENDIF

ENDFOR
ENDIF
*****************
I have some code in the 'on new' method of the child bizobj (which includes dodefault() ). If I stop the process in the 'on new' method, type 'set' in the command window and browse the view of the child record, I find the information added to the view in the 'on new' method showing up on the view.
I then close the browse go back to the debugger and continue processing. After these steps, and I enter the data in the parent record and save the parent, the child record is in the child table!!!!!

If I do not browse the view while in the 'on new' method the view apparently does not get updated to the table. As I said in my earlier message the Id# increments in the Id table (for the child record and the parent)in all cases.

I appears that I either did something technically incorrect in an earlier version of MM which has now been corrected, or I missed a tweak while updating from vs 6.0b to 7.0.

Any help would be appreciated.

Bill
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform