<?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: Stop the Submit if the form is open as read only</title><link>https://www.infopathdev.com:443/forums/thread/46176.aspx</link><pubDate>Mon, 24 Aug 2009 18:12:54 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:46176</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/46176.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=46176</wfw:commentRss><description>&lt;p&gt;You can find out if it is read only using XDocument.IsReadOnly. See &lt;a href="http://msdn.microsoft.com/en-us/library/bb250796.aspx"&gt;this&lt;/a&gt; MSDN entry for more.&lt;/p&gt;</description></item><item><title>Stop the Submit if the form is open as read only</title><link>https://www.infopathdev.com:443/forums/thread/46101.aspx</link><pubDate>Thu, 20 Aug 2009 19:21:41 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:46101</guid><dc:creator>Danielle</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/46101.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=46101</wfw:commentRss><description>&lt;p&gt;Hi friends,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;I have the below code that runs for my submit that is running off of a button.&amp;nbsp; Does anyone know how to (what to) put to stop this from running and give an error message if the form is open as read only?&amp;nbsp; I am getting row update errors if someone trys to submit it as read only, there ends up being a conflict.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;function CTRL2114_7::OnClick(eventObj) &lt;/p&gt;
&lt;p&gt;{ try &lt;/p&gt;
&lt;p&gt;{ 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;&amp;nbsp;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;
&lt;p&gt;} &lt;/p&gt;</description></item></channel></rss>