I have the following code in a InfoPath form that should update a list with items from a repeating table.
For some reason the code runs i get no errors but the list is not updated with the items, can't seem to figure out why the data connection that submits uses: http://servername/_vti_bin/lists.asmx?
Can someone take a look and let me know if they see anything obvious.
// Delete all Method nodes from the CAML Batch XML
XPathNavigator secDSNav = DataSources["CustomListCAML"].CreateNavigator();
XPathNodeIterator iter = secDSNav.Select("/Batch/Method");
int methodNodesCount = iter.Count;
XPathNavigator firstMethodNav = secDSNav.SelectSingleNode("/Batch/Method[1]", NamespaceManager);
XPathNavigator lastMethodNav = secDSNav.SelectSingleNode("/Batch/Method[" + methodNodesCount.ToString() + "]", NamespaceManager);
firstMethodNav.DeleteRange(lastMethodNav);
// Retrieve the rows of the repeating table
XPathNavigator root = MainDataSource.CreateNavigator();
XPathNodeIterator rows = root.Select("/my:myFields/my:RepeatingCheck/my:CheckTable", NamespaceManager);
// Loop through the rows of the repeating table
// and construct the CAML Batch XML
int counter = 1;
while (rows.MoveNext())
{
// Retrieve the title
string Check = rows.Current.SelectSingleNode("my:Check", NamespaceManager).Value;
Check = SecurityElement.Escape(Check);
string Service = rows.Current.SelectSingleNode("my:Service", NamespaceManager).Value;
Service = SecurityElement.Escape(Service);
string Outcome = rows.Current.SelectSingleNode("my:Outcome", NamespaceManager).Value;
Outcome = SecurityElement.Escape(Outcome);
string ActionNotes = rows.Current.SelectSingleNode("my:ActionNotes", NamespaceManager).Value;
ActionNotes = SecurityElement.Escape(ActionNotes);
string Ticket = rows.Current.SelectSingleNode("my:TicketRaised", NamespaceManager).Value;
// Add an item to the CAML Batch XML
AddMethodNode(counter, Check, Service, Outcome, ActionNotes, Ticket);
// Increment the counter
counter++;
}
// Submit the rows to the Lists web service to update the custom list
DataConnections["ListItemsSubmit"].Execute();
}
}
}