<?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>SharePoint Integration</title><link>https://www.infopathdev.com:443/forums/46.aspx</link><description> For questions concerning issues in the integration of SharePoint and Microsoft InfoPath.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Read Only mode (file locking)</title><link>https://www.infopathdev.com:443/forums/thread/39964.aspx</link><pubDate>Wed, 25 Mar 2009 12:32:24 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:39964</guid><dc:creator>geoffc</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/39964.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=46&amp;PostID=39964</wfw:commentRss><description>&lt;p&gt;This is what I did for now. I have&amp;nbsp;the code&amp;nbsp;setting a flag in the loading event if the form is in read only mode. I then have a field that displays &amp;quot;This form is in read only mode&amp;quot; and have buttons that hide if this flag is set to &amp;quot;Y&amp;quot; (conditional formatting). I found that a lot of users could not tell the difference&amp;nbsp;between read-only&amp;nbsp;and edit mode and were actually filling out the form in read-only mode.&amp;nbsp;With SharePoint integrated forms, if&amp;nbsp;the form is in read-only mode, it will only&amp;nbsp;allow you to&amp;nbsp;save it to your hard drive.&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;public&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;void&lt;/font&gt;&lt;font size="2"&gt; FormEvents_Loading(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;object&lt;/font&gt;&lt;font size="2"&gt; sender, &lt;/font&gt;&lt;font color="#008080" size="2"&gt;LoadingEventArgs&lt;/font&gt;&lt;font size="2"&gt; e)&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;{&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;if&lt;/font&gt;&lt;font size="2"&gt; (&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;this&lt;/font&gt;&lt;font size="2"&gt;.ReadOnly.Equals(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;true&lt;/font&gt;&lt;font size="2"&gt;))&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;{&lt;/p&gt;&lt;/font&gt;&lt;font color="#008080" size="2"&gt;XPathNavigator&lt;/font&gt;&lt;font size="2"&gt; mainData = MainDataSource.CreateNavigator();&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;mainData.SelectSingleNode(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;/dfs:myFields/my:readOnly&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager).SetValue(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;Y&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;else&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;{&lt;/p&gt;&lt;/font&gt;&lt;font color="#008080" size="2"&gt;XPathNavigator&lt;/font&gt;&lt;font size="2"&gt; mainData = MainDataSource.CreateNavigator();&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;mainData.SelectSingleNode(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;/dfs:myFields/my:readOnly&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager).SetValue(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;N&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;On a semi-related note, does anyone know how I can access the same code that is used for Word and Excel where if you try to open a document through SharePoint, it prompts the user to either select read-only or check out and edit? &lt;/p&gt;&lt;/font&gt;</description></item><item><title>Re: Read Only mode (file locking)</title><link>https://www.infopathdev.com:443/forums/thread/38867.aspx</link><pubDate>Tue, 24 Feb 2009 23:59:48 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:38867</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/38867.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=46&amp;PostID=38867</wfw:commentRss><description>&lt;p&gt;Hi, and welcome...&lt;/p&gt;
&lt;p&gt;In C#, in your OnLoad (IP2003)&lt;/p&gt;
&lt;blockquote&gt;&lt;font size="2"&gt;
&lt;p&gt;thisXDocument.IsReadOnly&lt;/p&gt;&lt;/font&gt;&lt;/blockquote&gt;
&lt;p&gt;Or in Loading (IP2007)&lt;/p&gt;
&lt;blockquote&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;
&lt;p&gt;this&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.ReadOnly&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;&lt;font size="2"&gt;Either of these return a boolean value of True if the document is read only and false if it is not. You could add a field to your form data source (or a secondary data source)&amp;nbsp;and in your loading code you could set the value to true or false depending on whether the form is read only. Then you could base your conditional formatting off that field....&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Read Only mode (file locking)</title><link>https://www.infopathdev.com:443/forums/thread/38837.aspx</link><pubDate>Tue, 24 Feb 2009 12:23:02 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:38837</guid><dc:creator>gregguz</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/38837.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=46&amp;PostID=38837</wfw:commentRss><description>&lt;p&gt;Hi All,&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0cm 0cm 0pt;"&gt;&lt;font face="Calibri" size="3"&gt;Environment:&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0cm 0cm 0pt;"&gt;&lt;font face="Calibri" size="3"&gt;Info Path 2003 (soon will be redesigned to 2007) and SharePoint Server2007 library.&lt;/font&gt;&lt;/p&gt;&lt;font face="Calibri" size="3"&gt;&amp;nbsp;&lt;/font&gt; 
&lt;p class="MsoNormal" style="MARGIN:0cm 0cm 0pt;"&gt;&lt;font face="Calibri" size="3"&gt;SharePoint is locking files when opened by other users, that’s fine :), it even warns users that document will be opened in Read-Only mode.&lt;/font&gt;&lt;/p&gt;&lt;font face="Calibri" size="3"&gt;&amp;nbsp;&lt;/font&gt; 
&lt;p class="MsoNormal" style="MARGIN:0cm 0cm 0pt;"&gt;&lt;font face="Calibri" size="3"&gt;Is there any way to detect (e.g. on open) that document is opened in ReadOnly mode?&lt;/font&gt;&lt;/p&gt;&lt;font face="Calibri" size="3"&gt;&amp;nbsp;&lt;/font&gt; 
&lt;p class="MsoNormal" style="MARGIN:0cm 0cm 0pt;"&gt;&lt;font face="Calibri" size="3"&gt;I would like to disable submit buttons or even switch to ‘print view’ so users do not try to submit form when they cannot. Of course submit will fail with some nice warning, but the other actions happen like sending email notification or change of some fields locally that is mistaken to users.&lt;/font&gt;&lt;/p&gt;&lt;font face="Calibri" size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;font face="Calibri" size="3"&gt;&amp;nbsp;&lt;/font&gt; 
&lt;p class="MsoNormal" style="MARGIN:0cm 0cm 0pt;"&gt;&lt;font face="Calibri" size="3"&gt;Thanks in advance,&lt;/font&gt;&lt;/p&gt;&lt;font face="Calibri" size="3"&gt;&amp;nbsp;&lt;/font&gt; 
&lt;p class="MsoNormal" style="MARGIN:0cm 0cm 0pt;"&gt;&lt;font face="Calibri" size="3"&gt;Greg.&lt;/font&gt;&lt;/p&gt;&lt;font face="Calibri" size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;font face="Calibri" size="3"&gt;&amp;nbsp;&lt;/font&gt; 
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>