|InfoPath Developer Reference|
Version Added: InfoPath 2003
expression An expression that returns a XDocument object.
|pEvent||Required||SaveEvent||An event object that is used during an OnSaveRequest event.|
If the ReturnStatus property of the SaveEvent object is set to False, InfoPath cancels the save operation. If an error occurs in the code for the OnSaveRequest event handler, InfoPath ignores the error and relies on the ReturnStatus property of the SaveEvent object. If the ReturnStatus property is not explicitly set, the default value of False is used.
The ReturnStatus property works in conjunction with the IsCancelled property when the InfoPath form is closing. If the document has changes that have not been saved and the user cancels the save operation, the IsCancelled property can be set to True to allow InfoPath to close.
In the following example, the OnSaveRequest event handler is used to create an XMLHTTP object for transporting the form's underlying XML document: