DataDOMEvent.ReturnStatus Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets a value indicating the return status of the data validation event.
public:
property bool ReturnStatus { bool get(); void set(bool value); };
public bool ReturnStatus { get; set; }
member this.ReturnStatus : bool with get, set
Public Property ReturnStatus As Boolean
Property Value
Implements
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.<span class="label">ReturnStatus</span> = false;
}
}
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.