StrataFrame Forum

Business Object - AfterSave Event

http://forum.strataframe.net/Topic11110.aspx

By Tim Dol - 8/27/2007

I need to perform an automated routine after a certain field changes in one of my BO's, so I added the AfterSave event handler to my business object and added the required code, however I've just discovered that the AfterSave event isn't getting executed. I tried placing a breakpoint in my code and it's definitely not reaching this point.

I tried adding the BeforeSave event handler to my business object and it appears this is working fine.

Any ideas?


Thanks

Tim

By StrataFrame Team - 8/28/2007

Are you calling Save() on the form, or Save() directly on the business object you want to save?
By Tim Dol - 9/2/2007

Save is on the Form.

Tim

By StrataFrame Team - 9/3/2007

Hrm, it seems that the AfterSave event only gets raised when the save is a success.  I don't think it gets raised if the save is aborted due to broken rules or has an completes with exceptions.

If _SaveResult = SaveUndoResult.Success Then
    '-- Only raise the after save event if the save was a success
    loAfterEventArg = New AfterSaveUndoEventArgs(lnRowsAffected)
    RaiseAfterSaveEvent(loAfterEventArg)
End If