ReturnStatus Property (DataDOMEvent Object)

Microsoft Office InfoPath

Sets or retrieves a Boolean value indicating the return status of the data validation event.

expression.ReturnStatus

expression    Required. Returns a reference to the DataDOMEvent object.

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.

Remarks

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.

Example

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;
      return;
   }
}