Share via


DataDOMEvent.IsUndoRedo Property

InfoPath Developer Reference

A read-only property that returns a Boolean value indicating whether the data validation event occurs during an undo operation or a redo operation. Read-only

Version Information
 Version Added:  InfoPath 2003

Syntax

expression.IsUndoRedo

expression   An expression that returns a DataDOMEvent object.

Return Value
Boolean

Remarks

When an undo or a redo operation takes place, the form's underlying XML document is placed in a read-only state and cannot be modified. This can sometimes occur during an OnAfterChange event; when it does, the IsUndoRedo property is used to bypass the script-based data validation that it contains.

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 IsUndoRedo property is used to determine whether the event is occurring during an undo or redo operation. If it is, the event handler is exited using the

JScript
  return;

statement.

JScript
  function msoxd__itemB_quantityListB::OnAfterChange(eventObj)
{
   if (eventObj.IsUndoRedo)
   {
      // An undo or redo operation has occurred and the DOM is read-only.
      return;
   }
   XDocument.DOM.selectSingleNode("/sampleData/listB/total").text = 
      GetTotal("/sampleData/listB/itemB/quantityListB");
}

See Also