This documentation is archived and is not being maintained.

DataDOMEvent.ReturnStatus Property

Office 2007
Sets or retrieves a Boolean value indicating the return status of the data validation event. Read/write

Version Information
 Version Added:  InfoPath 2003



expression   An expression that returns a DataDOMEvent object.

Return Value


If the ReturnStatus property is set to False, the changes to the XML Document Object Model (DOM) node are not accepted and the data validation event fails. If set to True, no data validation error has occurred and the data validation event is successful.

Security Level 2: Can be accessed only by forms running in the same domain as the currently open form, or by forms that have been granted cross-domain permissions.


In the following example, the ReturnStatus property of the DataDOMEvent object is used to indicate that the data validation event was not successful. The code also uses the ReturnMessage property of the DataDOMEvent object to display a message to the user.

function msoxd__id_attr::OnBeforeChange(eventObj)
   if (eventObj.NewValue == "")
      eventObj.ReturnMessage = "You must supply a value for this field.";
      eventObj.ReturnStatus = false;