InfopathProgramming and automation discussions only please. :)
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Infopath section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
How do I retrieve the correct ID in a SharePoint List using vb code after submission and after the form has been signed. I am trying to read and populate the ID field in my form so it can be printed out with a unique ID in that field.
I have the data connection setup correctly, but right now it only returns the first ID in the list. I don't necessarily want the last one in the list, because it may or may not be the last ID in the list. Please help!
This is a browser enabled form.
I am using the following code: but get the invalid token error
' Retrieve the value of the control number
Dim TSRNum As String = xnMyForm.SelectSingleNode("/my:myFields/my:TSRControlNum", ns).Value
' Retrieve a reference to the SharePoint list
Dim xPath As XPathNavigator = DataSources("TSRData").CreateNavigator()
' Search for the id in the SharePoint list
Dim SharePointID As XPathNavigator = xPath.SelectSingleNode("/my:myFields/my:TSRControlNum[@TSRID", ns)
'Dim SharePointID As XPathNavigator = xPath.SelectSingleNode("/dfs:myFields/dfs:dataFields/dfs:TSRData/@TSRID[ /my:myFields/my:TSRControlNum = current()]")
'Check whether the search returned a result
Dim IDRes As String = String.Empty
If SharePointID IsNot Nothing Then
IDRes = SharePointID.SelectSingleNode("@TSRID", ns).Value
End If