Share via


DataDOM.OnAfterChange Event

InfoPath Developer Reference

Occurs after changes to a form's underlying XML document have been accepted and after the OnValidate event has occurred.

Version Information
 Version Added:  InfoPath 2003

Syntax

expression.OnAfterChange(pDataDOMEvent)

expression   An expression that returns a DataDOM object.

Parameters

Name Required/Optional Data Type Description
pDataDOMEvent Required DataDOMEvent An event object that is used during Microsoft Office InfoPath 2007 data validation events.

Return Value
nothing

Remarks

This event handler does not allow users to cancel an operation.

The OnAfterChange event is typically used for changing data in a form after other changes have occurred—for example, making calculations or changing the structure of a form's underlying XML document.

Bb229732.vs_note(en-us,office.12).gif  Note
In some cases, events related to changes in a form's underlying XML document may occur more than once. For example, when existing data is changed, an insert and delete operation occurs.

Example

In the following example, the OnAfterChange event handler is used to call a custom function that performs calculations:

JScript
  function msoxd__ContactDates::OnAfterChange eventObj)
{
   if (eventObj.IsUndoRedo)
   {
      // An undo or redo operation has occurred and the DOM is read-only.
      return;
   }
   CalculateTotalCampaignCost();
}

See Also