<?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: Not Allowing Overwrite</title><link>https://www.infopathdev.com:443/forums/thread/9726.aspx</link><pubDate>Tue, 09 May 2006 19:25:49 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:9726</guid><dc:creator>CycleFitness</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/9726.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=9726</wfw:commentRss><description>Sorry, Matt.  I had mistakenly checked the "allow overwrite" checkbox.  The function works perfectly!  This forum is so awesome!&lt;br /&gt;&lt;br /&gt;Thank you, Matt!</description></item><item><title>Re: Not Allowing Overwrite</title><link>https://www.infopathdev.com:443/forums/thread/9725.aspx</link><pubDate>Tue, 09 May 2006 19:24:06 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:9725</guid><dc:creator>CycleFitness</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/9725.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=9725</wfw:commentRss><description>Hmmm ... I entered the code as follows:&lt;br /&gt;&lt;br /&gt;function CTRL19_5::OnClick(eventObj)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;if (XDocument.Errors.Count &amp;gt; 0)&lt;br /&gt;{&lt;br /&gt;XDocument.UI.Alert("Required information is missing as indicated by the red asterisk(s).")&lt;br /&gt;return;&lt;br /&gt;}&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;XDocument.Submit()&lt;br /&gt;}&lt;br /&gt;catch(e)&lt;br /&gt;{&lt;br /&gt;XDocument.UI.Alert("Sorry, the form has already been submitted.");&lt;br /&gt;Application.ActiveWindow.Close(true);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;I enter information that would cause the submit error (filename already exists) and when I click the button nothing happens.  I tested to confirm the trap for required fields still works and it does.  It seems something about the catch isn't working.&lt;br /&gt;</description></item><item><title>Re: Not Allowing Overwrite</title><link>https://www.infopathdev.com:443/forums/thread/9724.aspx</link><pubDate>Tue, 09 May 2006 19:04:59 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:9724</guid><dc:creator>Matt Faus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/9724.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=9724</wfw:commentRss><description>Hi Deb,&lt;br /&gt;&lt;br /&gt;A situation such as this is why the try...catch block was invented! Try this out, and for further info see&lt;a target="_blank" href=http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/b7a0a54e-dfaa-4e41-bf25-bcaa43e601fb.asp&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/b7a0a54e-dfaa-4e41-bf25-bcaa43e601fb.asp&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;if (XDocument.Errors.Count &amp;gt; 0)&lt;br /&gt;{&lt;br /&gt;XDocument.UI.Alert("Required information is missing as indicated by the red asterisk(s).")&lt;br /&gt;return;&lt;br /&gt;}&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;XDocument.Submit()&lt;br /&gt;}&lt;br /&gt;catch(e)&lt;br /&gt;{&lt;br /&gt;XDocument.UI.Alert( "Sorry, the form has already been submitted." );&lt;br /&gt;Application.ActiveWindow.Close(true);&lt;br /&gt;}&lt;br /&gt;}</description></item><item><title>Not Allowing Overwrite</title><link>https://www.infopathdev.com:443/forums/thread/5589.aspx</link><pubDate>Tue, 09 May 2006 18:17:27 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:5589</guid><dc:creator>CycleFitness</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/5589.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=5589</wfw:commentRss><description>Hello everyone:&lt;br /&gt;&lt;br /&gt;I'm visiting again the issue of using Code and how it supercedes the error trapping built into InfoPath.  I have to use Code to use the Application.ActiveWindow.Close(true) function so InfoPath closes once the form is submitted.  With that said, if I have the submit data connection set to not allow overwrite, InfoPath gives the user a JavaScript error message if they're trying to overwrite the form.  How to I intercept that condition and present a message telling the user they've already submitted the form?&lt;br /&gt;&lt;br /&gt;Currently, my code looks like this:&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;if (XDocument.Errors.Count &amp;gt; 0)&lt;br /&gt;{&lt;br /&gt;XDocument.UI.Alert("Required information is missing as indicated by the red asterisk(s).")&lt;br /&gt;return;&lt;br /&gt;}&lt;br /&gt;XDocument.Submit()&lt;br /&gt;Application.ActiveWindow.Close(true);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Thanks!&lt;br /&gt;Deb</description></item></channel></rss>