<?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>Newbie Questions</title><link>https://www.infopathdev.com:443/forums/39.aspx</link><description>New to InfoPath? Search to see if your question has already been answered. If it has not, then ask it here or the appropriate topic forum.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Swithing between Online/Offline mode</title><link>https://www.infopathdev.com:443/forums/thread/32951.aspx</link><pubDate>Thu, 09 Oct 2008 06:19:45 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:32951</guid><dc:creator>BlindBoyGrunt</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/32951.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=32951</wfw:commentRss><description>&lt;p&gt;This is how I tried to solve this in the loading event for the form:&lt;/p&gt;
&lt;p&gt;DateTime pubDate = DateTime.Now;&lt;/p&gt;
&lt;p&gt;DateTime formDate = DateTime.Now;&lt;/p&gt;
&lt;p&gt;XPathNavigator priceBookDate = null;&lt;/p&gt;
&lt;p&gt;//First we want to connect to the datasource GetPriceBookDate that only returns the latest publishing&lt;/p&gt;
&lt;p&gt;//date for the PriceBook. &lt;/p&gt;
&lt;p&gt;try&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; WebServiceConnection wsc = (WebServiceConnection)this.DataSources[&amp;quot;GetPriceBookDate&amp;quot;].QueryConnection;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; wsc.Execute();&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; XPathNavigator GetPriceBookDate = this.DataSources[&amp;quot;GetPriceBookDate&amp;quot;].CreateNavigator();&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; priceBookDate = GetPriceBookDate.SelectSingleNode(&amp;quot;/dfs:myFields/dfs:dataFields/tns:GetPriceBookDateResponse/tns:GetPriceBookDateResult&amp;quot;, this.NamespaceManager);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; //Get the date for the latest published pricebook&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; if (!String.IsNullOrEmpty(priceBookDate.Value))&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; pubDate = Convert.ToDateTime(priceBookDate.Value);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;catch&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;//Here we want to work against the cached data for the datasource GetPriceBook that contains the whole PriceBook&lt;/p&gt;
&lt;p&gt;//This doesn&amp;#39;t work if we are in online mode. &lt;/p&gt;
&lt;p&gt;XPathNavigator GetPriceBook = this.DataSources[&amp;quot;GetPriceBook&amp;quot;].CreateNavigator();&lt;/p&gt;
&lt;p&gt;//Get the cached date. &lt;/p&gt;
&lt;p&gt;XPathNavigator formPriceBookDate = GetPriceBook.SelectSingleNode(&amp;quot;/dfs:myFields/dfs:dataFields/tns:GetPriceBookResponse/tns:GetPriceBookResult/tns:PublishingDate&amp;quot;, this.NamespaceManager);&lt;/p&gt;
&lt;p&gt;if (priceBookDate != null)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; //Get the date for the latest publised pricebook that was cached in the form&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; if (!String.IsNullOrEmpty(formPriceBookDate.Value))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; formDate = Convert.ToDateTime(formPriceBookDate.Value);&lt;/p&gt;
&lt;p&gt;//Give the user an option to download a new pricebook if there is a newer version &lt;br /&gt;//published or if the user hasn&amp;#39;t a PriceBook cached&lt;/p&gt;
&lt;p&gt;if ((formDate &amp;lt; pubDate) || String.IsNullOrEmpty(formPriceBookDate.Value))&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; DialogResult result = MessageBox.Show(&amp;quot;There is a new Price Book available. Do you want to download the new Price Book? &amp;quot;, null, MessageBoxButtons.YesNo, MessageBoxIcon.Question,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MessageBoxDefaultButton.Button2);&lt;/p&gt;
&lt;p&gt;if (result == DialogResult.Yes)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; WebServiceConnection wscPB = (WebServiceConnection)this.DataSources[&amp;quot;GetPriceBook&amp;quot;].QueryConnection;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; wscPB.Timeout = 1000;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; wscPB.Execute();&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;</description></item><item><title>Re: Swithing between Online/Offline mode</title><link>https://www.infopathdev.com:443/forums/thread/32824.aspx</link><pubDate>Mon, 06 Oct 2008 06:15:20 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:32824</guid><dc:creator>BlindBoyGrunt</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/32824.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=32824</wfw:commentRss><description>&lt;p&gt;Hi that&amp;#39;s exactly my idea but I can&amp;#39;t get to the cached data. If the form isn&amp;#39;t in offline mode it seems like I can&amp;#39;t get to it. When I try to move to a node in a data source that has been cached I can&amp;#39;t find any values if the form is in &amp;quot;online&amp;quot; mode. If I force it to offline mode then I can get to it. It seems kind of strange that I need to force it to offline mode to be able to access a cached data source.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;BR,&lt;/p&gt;
&lt;p&gt;Niclas&lt;/p&gt;</description></item><item><title>Re: Swithing between Online/Offline mode</title><link>https://www.infopathdev.com:443/forums/thread/32823.aspx</link><pubDate>Mon, 06 Oct 2008 06:06:20 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:32823</guid><dc:creator>Shiva</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/32823.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=32823</wfw:commentRss><description>&lt;span style="FONT-SIZE:10pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Verdana&amp;#39;,&amp;#39;sans-serif&amp;#39;;"&gt;Hello,&lt;/span&gt; 
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;span style="FONT-SIZE:10pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Verdana&amp;#39;,&amp;#39;sans-serif&amp;#39;;"&gt;Whenever you are first loading the secondary connection you have to set date to one field. Next time opens this form you have checked the condition to again connect to secondary connection or not? Based on data difference is more than 30 days then you having connected Product Catalog again otherwise get the cached one.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Re: Swithing between Online/Offline mode</title><link>https://www.infopathdev.com:443/forums/thread/32767.aspx</link><pubDate>Fri, 03 Oct 2008 12:33:53 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:32767</guid><dc:creator>BlindBoyGrunt</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/32767.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=32767</wfw:commentRss><description>&lt;p&gt;Ok I undertstand that I can get the online/offline&amp;nbsp;status by doing it this way. &lt;/p&gt;
&lt;p&gt;Let me more describe my problem.&lt;/p&gt;
&lt;p&gt;I have a web service as a data connection. The web service gets huge product catalog in a XML-file that will work as secondary data connection source. The&amp;nbsp;product catalog is published once a month. In the Xml there is a field with the last publishing date for the product catalog.I don&amp;#39;t want to query this connection each time I&amp;#39;m online as it would slow down the application, I just want to query it if a new product catalog has been published.&lt;/p&gt;
&lt;p&gt;My solution to this were to add another web service&amp;nbsp;as sec data connection that only pulled out the publishing date&amp;nbsp;from the XML. I then wants to compare this date to the one that is in the other data connection that&amp;nbsp;has been cached. The problem is that InfoPath always start in&amp;nbsp;online mode and then it seems like I can&amp;#39;t get to the cached data.&amp;nbsp;I would like to start in online mode, get the&amp;nbsp;date, then switch to offline mode and get&amp;nbsp;cached date.&amp;nbsp;I then would like to compare them and if a new product catalog&amp;nbsp;has been published I would like&amp;nbsp;to&amp;nbsp;query&amp;nbsp;the data connection that&amp;nbsp;gets the&amp;nbsp;product catalog. &lt;/p&gt;
&lt;p&gt;// Niclas &lt;/p&gt;</description></item><item><title>Re: Swithing between Online/Offline mode</title><link>https://www.infopathdev.com:443/forums/thread/32765.aspx</link><pubDate>Fri, 03 Oct 2008 12:13:45 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:32765</guid><dc:creator>swathip</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/32765.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=32765</wfw:commentRss><description>&lt;span style="FONT-SIZE:10pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Verdana&amp;#39;,&amp;#39;sans-serif&amp;#39;;"&gt;Hi,&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Verdana&amp;#39;,&amp;#39;sans-serif&amp;#39;;"&gt;Add a boolean field isOnline to the data source. Set the default value to true.&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Verdana&amp;#39;,&amp;#39;sans-serif&amp;#39;;"&gt;In onload write the following code lines.&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;FONT-FAMILY:&amp;#39;Verdana&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;thisXDocument.DOM.selectSingleNode(“xpath of the isOnline field”).text = &lt;/span&gt;&lt;span style="FONT-SIZE:10pt;FONT-FAMILY:&amp;#39;Verdana&amp;#39;,&amp;#39;sans-serif&amp;#39;;"&gt;Application.IsDestinationReachable(&amp;quot;URL of the destination&amp;quot;);&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;FONT-FAMILY:&amp;#39;Verdana&amp;#39;,&amp;#39;sans-serif&amp;#39;;"&gt;If isOnline value is true then that form is in online mode. If it is false the form is in offline mode.&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;FONT-FAMILY:&amp;#39;Verdana&amp;#39;,&amp;#39;sans-serif&amp;#39;;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Verdana&amp;#39;,&amp;#39;sans-serif&amp;#39;;"&gt;&amp;nbsp;&lt;/span&gt; 
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Swithing between Online/Offline mode</title><link>https://www.infopathdev.com:443/forums/thread/32761.aspx</link><pubDate>Fri, 03 Oct 2008 10:36:48 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:32761</guid><dc:creator>Shiva</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/32761.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=32761</wfw:commentRss><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;In onLoad depends the ‘IsDestinationReachable&amp;#39; value, we have set this value in form (xml) node depends on this field value we can do different operations for offline and online mode forms.&lt;/p&gt;</description></item><item><title>Re: Swithing between Online/Offline mode</title><link>https://www.infopathdev.com:443/forums/thread/32753.aspx</link><pubDate>Fri, 03 Oct 2008 06:10:33 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:32753</guid><dc:creator>BlindBoyGrunt</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/32753.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=32753</wfw:commentRss><description>&lt;blockquote&gt;
&lt;p&gt;Ok, but how do you set it to offline/online by code?&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Niclas&lt;/p&gt;&lt;/blockquote&gt;</description></item><item><title>Re: Swithing between Online/Offline mode</title><link>https://www.infopathdev.com:443/forums/thread/32752.aspx</link><pubDate>Fri, 03 Oct 2008 06:05:06 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:32752</guid><dc:creator>Shiva</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/32752.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=32752</wfw:commentRss><description>&lt;p&gt;Hello.&lt;/p&gt;
&lt;p&gt;We will the get offline or online form by using the below code,&lt;/p&gt;
&lt;p&gt;Application.IsDestinationReachable(&amp;quot;URL of the destination&amp;quot;)&lt;/p&gt;
&lt;p&gt;If this value returns false then we need to set form is in offline mode otherwise online form.&lt;/p&gt;</description></item><item><title>Swithing between Online/Offline mode</title><link>https://www.infopathdev.com:443/forums/thread/32733.aspx</link><pubDate>Thu, 02 Oct 2008 14:08:03 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:32733</guid><dc:creator>BlindBoyGrunt</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/32733.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=32733</wfw:commentRss><description>&lt;p&gt;Hi &lt;/p&gt;
&lt;p&gt;Is there a possibility to switch between online/offline mode by code?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;BR&lt;br /&gt;Niclas&lt;/p&gt;</description></item></channel></rss>