<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>General</title><link>https://www.infopathdev.com:443/forums/41.aspx</link><description>If you're not sure where to ask your question, ask it here. If necessary, our moderators will make sure it gets classified in the correct board.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Code does not work on Web Form</title><link>https://www.infopathdev.com:443/forums/thread/64710.aspx</link><pubDate>Tue, 01 Mar 2011 20:01:31 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:64710</guid><dc:creator>Michael Vasquez</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/64710.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=64710</wfw:commentRss><description>&lt;p&gt;Yes, I have admin deployed.&amp;nbsp; I am using SharePoint2007.&lt;/p&gt;</description></item><item><title>Re: Code does not work on Web Form</title><link>https://www.infopathdev.com:443/forums/thread/64706.aspx</link><pubDate>Tue, 01 Mar 2011 18:32:14 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:64706</guid><dc:creator>Ted Fitch</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/64706.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=64706</wfw:commentRss><description>&lt;p&gt;Hi Michael,&lt;/p&gt;
&lt;p&gt;What version of SharePoint are you using?&lt;/p&gt;
&lt;p&gt;If it&amp;#39;s SharePoint 2007 did you make sure to admin deploy the form and approve it in SharePoint?&amp;nbsp; That is required with a web form with code.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;If you are using SharePoint 2010 you can admin deploy or you can use the sandbox (no admin deploy required).&lt;/p&gt;
&lt;p&gt;Hope that helps&lt;/p&gt;
&lt;p&gt;Ted&lt;/p&gt;</description></item><item><title>Code does not work on Web Form</title><link>https://www.infopathdev.com:443/forums/thread/64702.aspx</link><pubDate>Tue, 01 Mar 2011 16:59:07 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:64702</guid><dc:creator>Michael Vasquez</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/64702.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=64702</wfw:commentRss><description>&lt;p&gt;I have a function that counts the number of attendees in a schedule class data and assign the next seat number according to what the count is.&amp;nbsp; It works in Infopath but does not work on an Infopath Web form.&amp;nbsp; In the Infopath Web form, it always returns one.&amp;nbsp; I have searched and searched for an another but to no avail.&amp;nbsp; Her is the code.&amp;nbsp; I was wondering if anyone would know how to do this using rules.&amp;nbsp; I tried figuring out how to use rules but could not.&lt;/p&gt;
&lt;p&gt;Public Function setSeatNum() As Integer&lt;/p&gt;
&lt;p&gt;Dim xPath As XPathNavigator = DataSources(&amp;quot;SharePoint Training&amp;quot;).CreateNavigator()&lt;br /&gt;Dim ns As XmlNamespaceManager = Me.NamespaceManager&lt;br /&gt;Dim SeatIter As XPathNodeIterator = xPath.Select(&amp;quot;/dfs:myFields/dfs:dataFields/dfs:SharePoint_Training/@Seat__&amp;quot;, ns)&lt;br /&gt;Dim classDate As XPathNodeIterator = xPath.Select(&amp;quot;/dfs:myFields/dfs:dataFields/dfs:SharePoint_Training/@Class_Date&amp;quot;, ns)&lt;br /&gt;Dim xForm As XPathNavigator = Me.CreateNavigator()&lt;br /&gt;Dim formClassDate As Date = xForm.SelectSingleNode(&amp;quot;/my:SharePointTraining/my:dClassDate&amp;quot;, ns).Value&lt;br /&gt;Dim seatNum As XPathNavigator = xForm.SelectSingleNode(&amp;quot;/my:SharePointTraining/my:seat&amp;quot;, ns)&lt;br /&gt;Dim availSeats As XPathNavigator = xForm.SelectSingleNode(&amp;quot;/my:SharePointTraining/my:AvailSeats&amp;quot;, ns)&lt;br /&gt;Dim cnt As Integer&lt;br /&gt;Dim dClassDate As Date&lt;/p&gt;
&lt;p&gt;While (SeatIter.MoveNext())&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; classDate.MoveNext()&lt;br /&gt;&amp;nbsp;&amp;nbsp; dClassDate = classDate.Current.Value&lt;br /&gt;&amp;nbsp;&amp;nbsp; If formClassDate = dClassDate Then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cnt = cnt + 1&lt;br /&gt;&amp;nbsp;&amp;nbsp; End If&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; If formClassDate &amp;gt; dClassDate Then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exit While&lt;br /&gt;&amp;nbsp;&amp;nbsp; End If&lt;br /&gt;End While&lt;/p&gt;
&lt;p&gt;If cnt &amp;gt; 1 Then&lt;br /&gt;&amp;nbsp;&amp;nbsp; seatNum.SetValue(cnt)&lt;br /&gt;&amp;nbsp;&amp;nbsp; availSeats.SetValue(CStr((10 - cnt)))&lt;br /&gt;ElseIf cnt = 0 Then&lt;br /&gt;&amp;nbsp;&amp;nbsp; seatNum.SetValue(cnt + 1)&lt;br /&gt;&amp;nbsp;&amp;nbsp; availSeats.SetValue(CStr(10))&lt;br /&gt;Else&lt;br /&gt;&amp;nbsp;&amp;nbsp; seatNum.SetValue(cnt + 1)&lt;br /&gt;&amp;nbsp;&amp;nbsp; availSeats.SetValue(CStr(10) - cnt)&lt;br /&gt;End If&lt;/p&gt;
&lt;p&gt;&amp;#39;clean up&lt;/p&gt;
&lt;p&gt;xPath = Nothing&lt;br /&gt;ns = Nothing&lt;br /&gt;SeatIter = Nothing&lt;br /&gt;classDate = Nothing&lt;br /&gt;xForm = Nothing&lt;br /&gt;formClassDate = Nothing&lt;br /&gt;seatNum = Nothing&lt;br /&gt;availSeats = Nothing&lt;/p&gt;
&lt;p&gt;End Function&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Thanks, in advance&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Mike&lt;/p&gt;</description></item></channel></rss>