Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Textbox with R format
Message
 
 
To
07/07/2005 11:50:18
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01029824
Message ID:
01030001
Views:
15
>"If the phone is empty, we don't want a warning, but we don't want to save this record either."
>Do not warn and do not proceed to save routine then (actually isn't that Save routine already doing these checks). I do something like this:
>
>
* myEditorButtons::SaveRecord
>if .BeforeSave()
> .Save()
> .AfterSave()
>endif
>
I do not use GetFldState() and explicitly check my rules.
>Cetin

The problem is, what I'm working with a MereMortals framework. The form's save routine is basically like this:

it calls Save method of the main biz object.

The save routine of the biz object has:

If the object changed (or any of its children/grandchildren changed) initiate the save method. First, check rules for this object and its children. Then if everything is fine, save itself, then loop through children and save them. If any of the children has a problem, rollback the whole transaction.

So, I guess, I have to trick IsChanged method for this biz object. E.g. if it's new and empty, I have to return .f., e.g. the object is not changed. So, the record would not be saved.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform