Hi To everyone! I have a question for you! This is my first post but I know this site from 2/3 months and I know it is very cool!
In my infopath document I have 2 secondary data connection:
1) "Procedura" a data connection by SQL Server
2) "testa_doc" a dtata connection by SharePoint Site
I write this jscript code to query and browse the first data connection and it works:
objDataObject = XDocument.DataObjects("Procedura");
objDataObject.QueryAdapter.Command = "execute dbo.scegli_Versione " + "'" + CP5 + "', " + "'" + CP6 + "'";
objDataObject.Query();
ObjDataObject = null;
var strXML;
strXML = XDocument.DataObjects("Procedura").DOM.xml;
var xmldoc = new ActiveXObject("Msxml2.DOMDocument");
xmldoc.loadXML(strXML);
try { var CP7 = xmldoc.selectSingleNode("/dfs:myFields/dfs:dataFields/d:Procedura/@fdProceduraVersione").text; }
catch(e) { XDocument.DOM.selectSingleNode("/my:myFields/my:VersioneNull").text = 1; }
So, i write this jscript code to browse the other data connection (I dont need to query it) and it doesent work:
var strXML;
strXML = XDocument.DataObjects("testa_doc").DOM.xml;
var xmldoc = new ActiveXObject("Msxml2.DOMDocument");
xmldoc.loadXML(strXML);
var CP7 = xmldoc.selectSingleNode("/dfs:myFields/dfs:dataFields/dfs:testa_doc/@ID").text;
XDocument.UI.Alert(CP7);
The error is on the line
var CP7 = xmldoc.selectSingleNode("/dfs:myFields/dfs:dataFields/dfs:testa_doc/@ID").text;
Object required.
Could you help me?
Thank you