Share via


DataDOMEvent.ReturnStatus property

Gets or sets a value indicating the return status of the data validation event.

Namespace:  Microsoft.Office.Interop.InfoPath.SemiTrust
Assembly:  Microsoft.Office.Interop.InfoPath.SemiTrust (in Microsoft.Office.Interop.InfoPath.SemiTrust.dll)

Syntax

'Declaration
Property ReturnStatus As Boolean
    Get
    Set
'Usage
Dim instance As DataDOMEvent
Dim value As Boolean

value = instance.ReturnStatus

instance.ReturnStatus = value
bool ReturnStatus { get; set; }

Property value

Type: System.Boolean

Implements

DocActionEvent.ReturnStatus
DocReturnEvent.ReturnStatus

Remarks

For the OnBeforeChange event, 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.

Important

This member 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.

Examples

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

[InfoPathEventHandler(MatchPath="/Customers/Customer/RepVisitDt", EventType=InfoPathEventType.OnBeforeChange)]
public void RepVisitDt_OnBeforeChange(DataDOMEvent e)
{
 if (e.NewValue.ToString() == "")
 {
  e.ReturnMessage = "You must supply a value for this field.";
  e.ReturnStatus = false;
 }
}

See also

Reference

DataDOMEvent interface

DataDOMEvent members

ReturnStatus overload

Microsoft.Office.Interop.InfoPath.SemiTrust namespace