Unable to update a Node using OnAfterChange event

K

Keith B

I need to update the "dateModified" element in a Node when any one of many
Node element values is changed. Rather than creating a rule for every field
that possibly could change, I inserted the following code into the
"onAfterChange" event for the Node. The problem is, that changing a field in
the Node, and then saving the xml file does not result in a change to the
dateModified field. I suspect that the DOM is read only when the
OnAfterChange event fires. Is there another way to accomplish this?

function msoxd_ut_unitTest::OnAfterChange(oEvent)
{
if (XDocument.IsDOMReadOnly)
return;
// A field change has occurred and the DOM is writable.
if (oEvent.Source.nodeName == "ut:unitTest")
{
var xmlDateModified = oEvent.Source.selectSingleNode("ut:dateModified");
setNodeValue(xmlDateModified, getDateString());
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top