<?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: DataAdapters["..."].Submit(); works in 2003 but not in 2007</title><link>https://www.infopathdev.com:443/forums/thread/46174.aspx</link><pubDate>Mon, 24 Aug 2009 17:05:08 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:46174</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/46174.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=46174</wfw:commentRss><description>&lt;p&gt;I think you can use e.ToString() to get the stack trace... at least that&amp;#39;s what I&amp;#39;d do in C#.&lt;/p&gt;</description></item><item><title>DataAdapters["..."].Submit(); works in 2003 but not in 2007</title><link>https://www.infopathdev.com:443/forums/thread/46091.aspx</link><pubDate>Thu, 20 Aug 2009 15:09:15 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:46091</guid><dc:creator>admot</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/46091.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=46091</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Hi!&lt;/p&gt;&lt;p&gt;I created an .xsn form in IP 2003. I have the submit button using custom code for various reasons. When the user clicks the submit button, they can either submit or cancel. Below is the jscript code I used.&lt;br /&gt;&lt;/p&gt;function XDocument::OnSubmitRequest(eventObj)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; eventObj.ReturnStatus = true;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; try&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // Open data connection to send email.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; XDocument.DataAdapters[&amp;quot;ExtranetSubmit&amp;quot;].Submit();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; XDocument.UI.Alert(&amp;quot;The form was submitted successfully.&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // Setting ActiveWindow.Close to true will close InfoPath immediately.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // Setting to false prompts to save the form.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // Tried several ways to save prior to submit i.e., xDocument.SaveAs, WshShell.SendKeys(&amp;quot;^(p)&amp;quot;), etc.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // however, none seem to work prior to submitting.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // This can be resolved in InfoPath 2007 and C#.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Application.ActiveWindow.Close(false);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; catch(e)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; XDocument.UI.Alert(&amp;quot;The form has not been submitted due to the user cancelling the request.&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;This works fine in IP 2003 w/ Outlook 2003. But a user with IP 2007
with Outlook 2003 gets the &amp;quot;The form has not been submitted due to the
user cancelling...&amp;quot; message immediately after clicking the submit button. It seems to catch an error.&lt;/p&gt;&lt;p&gt;Questions:&lt;/p&gt;&lt;p&gt;1) Is there an issue w/ IP 2007 using DataAdapters? My research says it should work fine.&lt;/p&gt;&lt;p&gt;2) Is there a way to find out what the exact error is?&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Thanks! &lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>