Hi, i've tried to follow what you've listed but I'm missing something, but what?
I keep getting an error ( Object doesn't support this property or method) on the section in bold . If i uncomment the DOM and GETDOM sections to declare the namespace, it's the same error..
Primary Datasource= Repeating Table called RT_directreports, containing a couple of fields
Secondary Datasource(pricing) = Repeating Table through an Oracle Webservice
function CTRL7_5::OnClick(eventObj)
{
//XDocument.GetDOM("pricing").SetProperty("SelectionNameSpaces",'xmlns:dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution"');
//XDocument.DOM.SetProperty("selectionNamespaces",'xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2008-02-16T21:00:45"')
var myclone=XDocument.DOM.SelectSingleNode("/my:myFields/my:RT_directreports").cloneNode(true);
XDocument.DOM.SelectNodes("/my:myFields/my:RT_directreports").Removeall();
var nodes=XDocument.GetDOM("Pricing").SelectNodes("/dfs:myFields/dfs:dataFields/tns:pricingResponse/tns:pricingResult/NewDataSet/Table");
foreach (node in nodes)
{
myclone.selectSingleNode("/my:F_Country").text = node.SelectsingleNode("C").text;
myclone.selectSingleNode("/my:F_Lastname").text = node.SelectsingleNode("SN").text;
myclone.selectSingleNode("/my:F_Firstname").text = node.SelectsingleNode("Givenname").text;
myclone.selectSingleNode("/my:mail").text = node.SelectsingleNode("mail").text;
XDocument.DOM.SelectSingleNode("my:myfields").appendChild(clone.cloneNode(true));
}
Yes, i want to get all the data from the secondary datasource autofiled into a new table and save that data with the form.
If i save it like this, the form is empty, it doesn't keep the secondary data in.
Using infopath 2003 SP2 .
Appreciate your time and effort
K