OnVersionUpgrade not working

T

T-Bone

Schema validation error:

Element 'Portfolio_Segment_Level_two' is unexpected according to
content model of parent element
'{http://schemas.microsoft.com/office/infopath/2003/myXSD/2005-05-04T17:49:26}Portfolio_Segment_Section'.
Expecting:
{http://schemas.microsoft.com/office/infopath/2003/myXSD/2005-05-04T17:49:26}Portfolio_Segment_Level_two,
{http://schemas.mi....

Code:

function XDocument::OnVersionUpgrade(eventObj)
{
if
(!XDocument.DOM.selectSingleNode("//my:General_information/my:portfolio_Segment_Section/my:portfolio_Segment_Level_two"))
{
try
{
// Create the new element.
var objItemNode =
XDocument.DOM.selectSingleNode("//my:General_information/my:portfolio_Segment_Section").ownerDocument.createElement("my:portfolio_Segment_Level_two");

// Add the new <item> element to the XML document as a
// child of the <order> element.

XDocument.DOM.selectSingleNode("//my:General_information/my:portfolio_Segment_Section").appendChild(objItemNode);
eventObj.ReturnStatus=true;
}
catch(ex)
{
XDocument.UI.Alert("There was an error inserting the node: " +
ex.description);
eventObj.ReturnStatus=false;
}
}
}


This makes no sense, all i want is to add Portfolio_Segment_Level_two
under Portfolio_Segment_Section. Portfolio_Segment_Section is under
General_information which is off the root.

Any help here would be greatly appreciated!
 

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