Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Clistobjedit - Deleting records programmatically
Message
 
To
24/08/2000 10:34:38
Gerald McKinsey
Keystone Consulting Services, Inc.
Yorktown, Indiana, United States
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Miscellaneous
Thread ID:
00408580
Message ID:
00408794
Views:
15
>> * First attempt using delete
Hi,

I tried to do all this outside of a form. Created a test table, a test dataenv, a test bizobj with the same results, so I think it's entirely a buffering detail that I'm missing.

Here's what I'm doing now (testing directly on the bizobj):

o = createobj("test_bo")
o.requery()
o.new()
replace cstatus with "this is only a hobby"
o.delete()

* BOOM - I get the message about the other user yada yada yada...

Alex


>> * This.Parent.Parent.Page2.cMoneyListObj.CListObj1.delete()
>
>Are you using your own business object to populate the grid, or the built in one that comes with cListObjEdit?
>
>Either way, you need to call the BizObj's delete method. Looks like you were calling one of the components of the grid. How about:
>
>This.Parent.Parent.Page2.cMoneyListObj.oBizObj.Delete()
>This.Parent.Parent.Page2.cMoneyListObj.cListObj1.grdList.Refresh()
>
>Deleting records of a view of a dataenvironment of a business object should go through the business object (then all the rules can be enforced). And then refresh the grid.
>
>If you peek inside Kevin's code for the cListObjEdit's Delete button's Click method, you see that he makes a backup copy of the Form's Primary BizObj, puts the grid's bizobj up there, and then call ThisForm.Delete().
>Why? What does ThisForm.Delete() do that BizObj.Delete() doesn't do?
>Here's the code:
>
>IF llFormIsPresent
>
>        This.Parent.PreDeleteHook()
>       	loTempObject = ThisForm.oBizObj
>       	ThisForm.oBizObj = This.Parent.oBizObj
>       	lnRetVal = ThisForm.Delete()
>	ThisForm.oBizObj = loTempObject
>	IF lnRetVal = FILE_OK
>		This.Parent.CListObj1.grdList.Refresh()
>		This.Parent.CListObj1.grdList.SetFocus()
>	ENDIF
>
>	THISFORM.WaitMode(.F.)
>	ThisForm.LockScreen = .F.
>
>	This.Parent.PostDeleteHook()
>
>ENDIF
Low-carb diet not working? Try the Low-food diet instead!
Previous
Reply
Map
View

Click here to load this message in the networking platform