Hi!
I have an infopath form that has some fields and a button. When the button is clicked i would like to open up a new different form (based on xml) that has some of its fields already filled in with values from fields in the first form. But i get a permission denied error and cant figure out why. The code that generates the error is:
var oApp = new ActiveXObject("InfoPath.Application");
var oXDocumentCollection = oApp.XDocuments;
Application.ActiveWindow.Close(true);
var oXDocument = oXDocumentCollection.NewFromSolution("http://site/Uppdrag/Fakturor/Forms/template.xsn");
oXDocument.DOM.setProperty("SelectionNamespaces", 'xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-05-05T11:16:38"'); <---- This row causes the permission denied error
var fProjNr = oXDocument.DOM.selectSingleNode("//my:projektNummer");
var fProjName = oXDocument.DOM.selectSingleNode("//my:projektNamn");
fProjNr.text = uProjNrString;
fProjName.text = uProjNameString;