Share via


DataDOMEvent.ReturnStatus Property

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

Namespace:  Microsoft.Office.Interop.InfoPath
Assembly:  Microsoft.Office.Interop.InfoPath (in Microsoft.Office.Interop.InfoPath.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

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.

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.

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 Namespace