<?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>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: DataConnection not defined error</title><link>https://www.infopathdev.com:443/forums/thread/43958.aspx</link><pubDate>Wed, 08 Jul 2009 15:44:57 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:43958</guid><dc:creator>Danielle</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/43958.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=43958</wfw:commentRss><description>&lt;p&gt;Good Morning,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;I have finally got it working with the code below.&amp;nbsp; Thanks for all your help!&lt;/p&gt;
&lt;p&gt;function CTRL2114_7::OnClick(eventObj) &lt;/p&gt;
&lt;p&gt;{ try { XDocument.QueryAdapter.Timeout=240; &lt;/p&gt;
&lt;p&gt;XDocument.QueryAdapter.Submit(); &lt;/p&gt;
&lt;p&gt;XDocument.DataAdapters[&amp;quot;MainConnection&amp;quot;] &lt;/p&gt;
&lt;p&gt;XDocument.DataAdapters[&amp;quot;Submit&amp;quot;] .Submit(); &lt;/p&gt;
&lt;p&gt;XDocument.UI.Alert(&amp;quot;Document submitted successfully.&amp;quot;); &lt;/p&gt;
&lt;p&gt;eventObj.ReturnStatus = true; &lt;/p&gt;
&lt;p&gt;XDocument.SetDirty(false); &lt;/p&gt;
&lt;p&gt;XDocument.View.Window.Close(true); } &lt;/p&gt;
&lt;p&gt;catch(ex) &lt;/p&gt;
&lt;p&gt;{ XDocument.UI.Alert(ex.description); &lt;/p&gt;
&lt;p&gt;eventObj.ReturnStatus = false; } } &lt;/p&gt;</description></item><item><title>Re: DataConnection not defined error</title><link>https://www.infopathdev.com:443/forums/thread/43953.aspx</link><pubDate>Wed, 08 Jul 2009 15:32:05 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:43953</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/43953.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=43953</wfw:commentRss><description>&lt;p&gt;I don&amp;#39;t know what is on line 64 of your jscript file -- which is what the error is on. Like I said, CloseDocument() was a guess based on the MSDN docs. It could be wrong.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb735652(office.11).aspx"&gt;MSDN labs&lt;/a&gt; show this code snippet:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR:green;"&gt;// Tell InfoPath the submit was successful.&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; eventObj.ReturnStatus = &lt;span style="COLOR:blue;"&gt;true&lt;/span&gt;;&lt;/p&gt;&lt;/blockquote&gt;</description></item><item><title>Re: DataConnection not defined error</title><link>https://www.infopathdev.com:443/forums/thread/43919.aspx</link><pubDate>Wed, 08 Jul 2009 00:57:22 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:43919</guid><dc:creator>Danielle</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/43919.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=43919</wfw:commentRss><description>&lt;p&gt;Hi, &amp;nbsp;Thank you for responding,&lt;/p&gt;
&lt;p&gt;We are having network problems and have many remote users so they were getting&amp;nbsp;timeout error.&amp;nbsp; I was told the only way to correct this was with code to change the timeout setting on submit.&amp;nbsp; Our SharePoint adminstrators would not budge on changing it on their level.&amp;nbsp; &amp;nbsp;When I tried DataAdapter there, I got an error, QueryAdapter works and I don&amp;#39;t get the timeout errors.&amp;nbsp; The code is working now except saying it failed, when it really didn&amp;#39;t.&lt;/p&gt;
&lt;p&gt;I put in your line and got the error:&lt;/p&gt;
&lt;p&gt;InfoPath cannot submit the form.&lt;br /&gt;The onSubmitRequest event handler did not work.&lt;br /&gt;The following error occurred:&lt;/p&gt;
&lt;p&gt;Object doesn&amp;#39;t support this property or method&lt;br /&gt;File:script.js&lt;br /&gt;Line:64&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Any ideas? &lt;/p&gt;
&lt;p&gt;&amp;nbsp;Many Thanks!&lt;/p&gt;</description></item><item><title>Re: DataConnection not defined error</title><link>https://www.infopathdev.com:443/forums/thread/43918.aspx</link><pubDate>Wed, 08 Jul 2009 00:48:38 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:43918</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/43918.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=43918</wfw:commentRss><description>&lt;p&gt;I&amp;#39;m a little confused by the query adapter and what it is doing? I can see that you have the submit adapter and are using it to submit the form, but the query adapter is the one you are setting the timeout on?&lt;/p&gt;
&lt;p&gt;I&amp;#39;m kind of javascript impaired, but I think you can close the form&amp;nbsp;with XDocument.CloseDocument().&lt;/p&gt;</description></item><item><title>Re: DataConnection not defined error</title><link>https://www.infopathdev.com:443/forums/thread/43917.aspx</link><pubDate>Wed, 08 Jul 2009 00:44:12 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:43917</guid><dc:creator>Danielle</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/43917.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=43917</wfw:commentRss><description>&lt;p&gt;OK, this code gets it to go to both connections, but it comes up and says it failed.&amp;nbsp; So I still need that sucess fail code I guess, any ideas?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;XDocument.QueryAdapter.Timeout=120; &lt;/p&gt;
&lt;p&gt;XDocument.QueryAdapter.Submit(); &lt;/p&gt;
&lt;p&gt;XDocument.DataAdapters[&amp;quot;MainConnection&amp;quot;] &lt;/p&gt;
&lt;p&gt;XDocument.DataAdapters[&amp;quot;Submit&amp;quot;] .Submit(); &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: DataConnection not defined error</title><link>https://www.infopathdev.com:443/forums/thread/43915.aspx</link><pubDate>Tue, 07 Jul 2009 23:33:12 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:43915</guid><dc:creator>Danielle</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/43915.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=43915</wfw:commentRss><description>&lt;p&gt;Ok Guys, getting closer...&amp;nbsp; I have the submit working, now I need to get it to close the form and give a success/failure message... HELP..&lt;/p&gt;
&lt;p&gt;XDocument.QueryAdapter.Timeout=120; &lt;/p&gt;
&lt;p&gt;XDocument.QueryAdapter.Submit(); &lt;/p&gt;
&lt;p&gt;XDocument.DataAdapters[&amp;quot;Submit&amp;quot;].Submit(); &lt;/p&gt;
&lt;p&gt;XDocument.UI.Alert(&amp;quot;The form was submitted successfully.&amp;quot;);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>DataConnection not defined error</title><link>https://www.infopathdev.com:443/forums/thread/43910.aspx</link><pubDate>Tue, 07 Jul 2009 21:00:17 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:43910</guid><dc:creator>Danielle</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/43910.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=43910</wfw:commentRss><description>&lt;p&gt;Hi guys,&lt;/p&gt;
&lt;p&gt;I am still struggling with a timeout error due to a slow network on my 2003 form.&amp;nbsp; I have come up with the below code (never written code in Jscript before) and now I am getting an error, Data Connection not defined. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;Can anyone tell me what lines I am missing?&lt;/p&gt;
&lt;p&gt;XDocument.QueryAdapter.Timeout=120; &lt;/p&gt;
&lt;p&gt;XDocument.QueryAdapter.Submit(); &lt;/p&gt;
&lt;p&gt;DataConnection.spConn=DataConnections[&amp;quot;Submit&amp;quot;]; &lt;/p&gt;
&lt;p&gt;spConn.Execute();&lt;/p&gt;</description></item></channel></rss>