<?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: Switch view based on user login Sharepoint group</title><link>https://www.infopathdev.com:443/forums/thread/91597.aspx</link><pubDate>Wed, 24 Jul 2013 13:13:09 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:91597</guid><dc:creator>kwasidenkyira</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/91597.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=91597</wfw:commentRss><description>Go behind the Infopath form and change the programming language to C#

Click on “File”, then “Options”, then click on “More Options” under the title “InfoPath Options” and then click on the “Design” tab in the new window that opens up.
The default programming language is listed in the “Programing Defaults” section of the new window. You can even select the location where your code will be stored.
Change the defaults to your liking and click on OK.   
 
Sorry I have to change login. I have lost my password, resetting password but having trouble doing that. So I have to create a new login Id to help</description></item><item><title>Re: Switch view based on user login Sharepoint group</title><link>https://www.infopathdev.com:443/forums/thread/91596.aspx</link><pubDate>Wed, 24 Jul 2013 09:12:15 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:91596</guid><dc:creator>dgajjar</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/91596.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=91596</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Hi,&lt;/p&gt;&lt;p&gt;&amp;nbsp;I am trying to implement the same code on my form which is a web enabled browser for 2010 and I cannot publish this as the programming language is incompatible to web enabled forms. Can you please let me know how you successfully implemented it.?&lt;/p&gt;&lt;p&gt;Dhiran&lt;/p&gt;</description></item><item><title>Re: Switch view based on user login Sharepoint group</title><link>https://www.infopathdev.com:443/forums/thread/78193.aspx</link><pubDate>Tue, 01 May 2012 16:58:28 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:78193</guid><dc:creator>denkyira</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/78193.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=78193</wfw:commentRss><description>&lt;p&gt;Hi &lt;/p&gt;
&lt;p&gt;I have solved the issue with nine simple lines of code. I looked at most of the solutions on the web and none including the one from clayton is addressing how to switch Infopath 2010 browser enabled forms views based on a login user&amp;#39;s sharePoint groups in a simple way , so I have decided to share my code so others facing the same challenges can follow:&lt;/p&gt;
&lt;p&gt;1. Create a group in your SharePoint site, in this example I called my &amp;quot;Administrators&amp;quot;&lt;/p&gt;
&lt;p&gt;2.Behind the Infopath 2010 form--&amp;gt;Developer---&amp;gt;Loading Event&lt;/p&gt;
&lt;p&gt;3.Add references to a): using Microsoft.SharePoint and b) using Microsoft.SharePoint.Security&lt;/p&gt;
&lt;p&gt;4. Add the code below to the public void FormEvents_Loading Event and give full trust to your Infopath 2010 form. Enjoy it !!!. It works like charm SPSecurity.RunWithElevatedPrivileges(delegate(){&lt;br /&gt;using (SPSite mySite = new SPSite(&amp;quot;http://yourser/SitePages/default.aspx&amp;quot;))&lt;br /&gt;{&lt;br /&gt;using (SPWeb oWeb1 = mySite.OpenWeb())&lt;br /&gt;{&lt;br /&gt;if (oWeb1.IsCurrentUserMemberOfGroup(oWeb1.Groups[&amp;quot;Administrators&amp;quot;].ID) == true)&lt;br /&gt;{e.SetDefaultView(&lt;br /&gt;&amp;quot;ReviewersView&amp;quot;);&lt;br /&gt;}&lt;br /&gt;else &lt;br /&gt;{&lt;br /&gt;e.SetDefaultView(&lt;br /&gt;&amp;quot;View 1&amp;quot;);&lt;br /&gt;}&lt;br /&gt;oWeb1.Close();&lt;br /&gt;mySite.Close();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;});&lt;br /&gt;}&lt;/p&gt;</description></item><item><title>Re: Switch view based on user login Sharepoint group</title><link>https://www.infopathdev.com:443/forums/thread/78161.aspx</link><pubDate>Tue, 01 May 2012 05:12:52 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:78161</guid><dc:creator>Jo-Anne Alfafara</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/78161.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=78161</wfw:commentRss><description>&lt;p&gt;Hello,&lt;/p&gt;&lt;p&gt;You can probably add a rule on Form Load that switches views based on condition (CurrentUser = approver1), something like that. &lt;/p&gt;&lt;p&gt;Jo-Anne&lt;/p&gt;</description></item><item><title>Switch view based on user login Sharepoint group</title><link>https://www.infopathdev.com:443/forums/thread/78157.aspx</link><pubDate>Tue, 01 May 2012 02:47:46 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:78157</guid><dc:creator>denkyira</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/78157.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=78157</wfw:commentRss><description>&lt;p&gt;I have created two views of &amp;nbsp;Infopath 2010 browser enabled forms.I&amp;nbsp;have also created a sharePoint 2010 groups&amp;nbsp;called &amp;quot;approvers&amp;quot;.&amp;nbsp;&amp;nbsp;I need to switch views based on the user&amp;#39;s in the&amp;nbsp;approvers group. Any help please. I will like VSTA code based solution but a non-code based with clear explanation will help. &lt;/p&gt;</description></item></channel></rss>