Hello nukkumatti,
I was reading this topic, because I have a similar problem. As a matter of fact I tried your code ( the 1st solution that you proposed) and it worked perfectly ( with my variables). After that I used this method in my IP form, but it kept showing me an error message "". I am posting now my code:
function CTRL90_5::OnClick(eventObj)
{
var secondFile = Application.XDocuments.NewFromSolution("Template location"); //the new template location on SharePoint
var crNumber = XDocument.DOM.selectSingleNode("/my:myCR/my:crForm/my:crNumberInit").text; //the value on the 1st form,that I have to pass to the new o
var aiID = secondFile.DOM.selectSingleNode("/my:myAI/my:aiNumber"); //the place in the new form where i place the above value
aiID.text=crNumber;
}
It seems that now it cannot select the field in the new form. It opens the new form, as well as select the the crNumber variable. But the last line gives me the error: " null " is null or not an object. From my point of view the error is that the variable aiID is not located by the XPath. It is very strange for me because the same method but with different variable name and Xpath worked perfect (for the Xpath in this case I am sure that it correct). I am lost ... I need some help.
Best regards,
Svetoslav