IsUndoRedo Property (DataDOMEvent Object)

Microsoft Office InfoPath

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

expression.IsUndoRedo

expression    Required. Returns a reference to the DataDOMEvent object.

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.

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.

Example

In the following example from the Data Validation developer sample form, 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 return; statement.

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");
}