Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Detecting a validation failure of child by grandparent c
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 6 SP5
Miscellaneous
Thread ID:
01092783
Message ID:
01092894
Views:
15
Bhavbuti,

Is there an explicit call to cForm.Save() like you have posted? If so it looks out of place.

>I guess I was not able to explain my problem. CodeBook has the following (puesdo) code:
>
>cForm.Save()
>
>IF NOT THIS.BeforeSave()
>   RETURN
>ENDIF
>
>*** save stuff here
>
>THIS.AfterSave()
>
IF NOT THIS.BeforeSave()
   RETURN
ENDIF

this.Save()

*** save stuff here

THIS.AfterSave()
So the base Save shouldn't be called until it's ok to save. Your form's override of BeforeSave would work like you have it coded.

>iForm.Save() does not have anything but iForm.BeforeSave() has the code you have seen, this is the one I have put in for my usage. But all of this is form code, yes I am validating key things in the MyForm.BeforeSave() but when I return a false, essentially cForm is doing a simple return without messaging. My code in iForm() does the messaging but I presume it will only message cForm problems. Actually I want to message MyForm generically in iForm.
>
>Any advice on how to modify iForm.Save() or iForm.BeforeSave() without modifying the framework code in cForm?
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform