Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
RefreshForm() after Form.Delete or cancel
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Title:
RefreshForm() after Form.Delete or cancel
Miscellaneous
Thread ID:
00689490
Message ID:
00689490
Views:
54
Hi,

I just put a Business Object on a form and put some buttons (Save, Delete, Cancel, etc.) on it where the appropriate form methods are called. Additionally I put some fields on the form. Then I ran the form and noticed that it doesn't get refreshed after Cancel and Delete. After Save, New, Last etc. it got refreshed.

The reason for this behaviour is: I forgot to set the oBizObj.lAutoPrimaryBizObj property to .T. Now I wonder, if it wouldn't be better to have a consistant behaviour. If there isn't any reason against it, I would prefer the behaviour, that the forms always gets refreshed, regardless of the setting of lAutoPrimaryBizObj, since the core functionality works. Then why shouldn't the refresh get done, when the record was actionally deleted?

Here is what causes the different behaviour:
*-- cBizObjForm::Delete

	CASE lnRetVal = FILE_OK
		*----------------------------------------------------
		*--- If the current business object is THE primary
		*--- business object, or at least an auto primary
		*--- bizobj, Refresh the form
		*----------------------------------------------------
		IF ThisForm.oBizObj.lPrimaryBizObj OR ;
		ThisForm.oBizObj.lAutoPrimaryBizObj
			This.SetFilePos()
			This.RefreshForm()
		ENDIF
*-- cBizObjForm::New

	*----------------------------------------  
	*--- Run the business object's New method
	*----------------------------------------
	lnRetVal = this.oBizObj.New()
  
	IF lnRetVal = FILE_OK
		This.PostNewHook()
		this.RefreshForm()
	ENDIF
Looking forward to any comments,
Armin

Armin Neudert
Regional Director (Stuttgart) of German FoxPro User Group dFPUG

MCP for Visual FoxPro

Expert/Editor of the VFP section in the German Codezone community portal
Next
Reply
Map
View

Click here to load this message in the networking platform