>"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:
>
>
>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