Here is the custom code. Note: this is a basic example that I used for testing, but the finished product is almost exactly the same, except there a many more fields.
Public Sub AddMethodNode(ByVal id As Integer, ByVal title As String, ByVal customername As String, ByVal customernumber As String, ByVal purchaseamount As String)
Dim sb As System.Text.StringBuilder = New System.Text.StringBuilder()
sb.AppendFormat("<Method ID=""{0}"" Cmd=""New"">", id.ToString())
sb.AppendFormat("<Field Name=""Title"">{0}</Field>", title)
sb.AppendFormat("<Field Name=""customername"">{0}</Field>", customername)
sb.AppendFormat("<Field Name=""customernumber"">{0}</Field>", customernumber)
sb.AppendFormat("<Field Name=""purchaseamount"">{0}</Field>", purchaseamount)
sb.AppendFormat("</Method>")
Dim methodXml As XmlDocument = New XmlDocument()
methodXml.LoadXml(sb.ToString())
Dim secDSNav As XPathNavigator = DataSources("CustomListCAML").CreateNavigator()
Dim batchNav As XPathNavigator = secDSNav.SelectSingleNode("/Batch", NamespaceManager)
batchNav.AppendChild(methodXml.DocumentElement.CreateNavigator())
End Sub
Public Sub CTRL15_5(ByVal sender As Object, ByVal e As ClickedEventArgs)
' Write your code here.
Dim secDSNav As XPathNavigator = DataSources("CustomListCAML").CreateNavigator()
Dim iter As XPathNodeIterator = secDSNav.Select("/Batch/Method")
Dim methodNodesCount As Integer = iter.Count
Dim firstMethodNav As XPathNavigator = _
secDSNav.SelectSingleNode("/Batch/Method[1]", _
NamespaceManager)
Dim lastMethodNav As XPathNavigator = _
secDSNav.SelectSingleNode("/Batch/Method[" & _
methodNodesCount.ToString() & "]", _
NamespaceManager)
firstMethodNav.DeleteRange(lastMethodNav)
' Retrieve the rows of the repeating table
Dim root As XPathNavigator = MainDataSource.CreateNavigator()
Dim rows As XPathNodeIterator = root.Select( _
"/my:myFields/my:rows/my:row", NamespaceManager)
' Loop through the rows of the repeating table
' and construct the CAML Batch XML
Dim counter As Integer = 1
While rows.MoveNext()
' Retrieve the title
Dim title As String = rows.Current.SelectSingleNode( _
"my:title", NamespaceManager).Value
Dim customername As String = rows.Current.SelectSingleNode( _
"my:customername", NamespaceManager).Value
Dim customernumber As String = rows.Current.SelectSingleNode( _
"my:customernumber", NamespaceManager).Value
Dim purchaseamount As String = rows.Current.SelectSingleNode( _
"my:purchaseamount", NamespaceManager).Value
' Add an item to the CAML Batch XML
AddMethodNode(counter, title, customername, customernumber, purchaseamount)
' Increment the counter
counter = counter + 1
End While
' Submit the rows to the Lists web service to update the custom list
DataConnections("CustomListItemsSubmit").Execute()
'close the form
Dim nav As XPathNavigator = MainDataSource.CreateNavigator()
nav.SelectSingleNode("//my:field18", NamespaceManager).SetValue("URL")
End Sub
End Class
End Namespace
Thanks for you're help.