Why does the below code in the Infopath Form work but does not work in a Web enabled Form. How can I fix this. I have posted this in many posts without a resolution.
Dim xPath As XPathNavigator = DataSources("SharePoint Training").CreateNavigator()
Dim ns As XmlNamespaceManager = Me.NamespaceManager
Dim SeatIter As XPathNodeIterator = xPath.Select("/dfs:myFields/dfs:dataFields/dfs:SharePoint_Training/@Seat__", ns)
Dim classDate As XPathNodeIterator = xPath.Select("/dfs:myFields/dfs:dataFields/dfs:SharePoint_Training/@Class_Date", ns)
Dim formClassDate As String = xForm.SelectSingleNode("/my:SharePointTraining/my:dClassDate", ns).Value
Dim availSeats As XPathNavigator = xForm.SelectSingleNode("/my:SharePointTraining/my:AvailSeats", ns)
Dim cnt As String = 0
For i = 1 To 15
classDate.MoveNext()
sDate = Left(classDate.Current.Value, 10)
If sDate = formClassDate Then
cnt = cnt + 1
Else
Exit For
End If
Next
availSeats.SetValue(cnt)
The cnt is 0 in the Web enabled form and currently, it should be 2
The sharepoint list contains many previous dates of the same class. I want to get the total count of available seats for an upcoming class
Is there a way I can accomplish the same thing using rules.
TIA Mike