DataDOMEvent.ReturnMessage Property

InfoPath Developer Reference

Sets or retrieves a string value indicating the error message that will be returned if the data validation event is not successful. Read/write

Version Information
 Version Added:  InfoPath 2003

Syntax

expression.ReturnMessage

expression   An expression that returns a DataDOMEvent object.

Return Value
String

Remarks

Used in conjunction with the ReturnStatus property of the DataDOMEvent object, the ReturnMessage property displays a message box to the user with the specified text message.

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.

Example

In the following example, the ReturnMessage property of the DataDOMEvent object is used to display a message to the user if the data validation for the XML DOM node fails:

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

See Also