<?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>Browser Forms</title><link>https://www.infopathdev.com:443/forums/40.aspx</link><description>For browser form specific questions</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Auto-view selection on upload or similar</title><link>https://www.infopathdev.com:443/forums/thread/23401.aspx</link><pubDate>Wed, 03 Oct 2007 01:34:36 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:23401</guid><dc:creator>carlosthejackal</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/23401.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=40&amp;PostID=23401</wfw:commentRss><description>&lt;p&gt;It would seem that this is for changing from one view to another with static data - my scenario is that I have 41 users that need to complete the form. They need to complete 14 fields on a line and save it.&lt;/p&gt;&lt;p&gt;I am proposing 41 views for them of several lines each (not much screen rendering).&lt;/p&gt;&lt;p&gt;I wanted to detect the UserName and from that switch to one of the 41 views, as initially mentioned I can set a field value to detect the UserName but can not get the code to trigger in the onload event (my bad programming no doubt).&lt;/p&gt;&lt;p&gt;Any ideas in theory should be simple if only I knew the syntax (some sample code would help me sleep at night)!&lt;/p&gt;&lt;p&gt;So my thoughts are:&lt;/p&gt;&lt;p&gt;Detect the UserName and if it equals a view in our instance Admin-location so they are Admin-Longreach etc. Once it detects this switch to that view onload.&lt;/p&gt;&lt;p&gt;If not equal to any of the 41 views then display the default (full page view).....sounds simple eh!&lt;/p&gt;&lt;p&gt;Help again!&lt;/p&gt;&lt;p&gt;I have been trying to use this simple peice of code in the onload section but to no avail - any idea&amp;#39;s?&lt;br /&gt;&lt;/p&gt;&lt;p&gt;switch (System.Environment.UserName)&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; {&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; case &amp;quot;Administrator&amp;quot;: XDocument.View.SwitchView(&amp;quot;Cornetts Group View&amp;quot;);&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; case &amp;quot;Admin-Banksia&amp;quot;: XDocument.View.SwitchView(&amp;quot;Admin-Banksia&amp;quot;);&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; case &amp;quot;Admin-Longreach&amp;quot;: XDocument.View.SwitchView(&amp;quot;Admin-Longreach&amp;quot;);&lt;br /&gt;&lt;br /&gt;&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; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Thanks&lt;/p&gt;&lt;p&gt;Carl&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Auto-view selection on upload or similar</title><link>https://www.infopathdev.com:443/forums/thread/23385.aspx</link><pubDate>Tue, 02 Oct 2007 12:56:42 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:23385</guid><dc:creator>Kalyan Gaddam</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/23385.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=40&amp;PostID=23385</wfw:commentRss><description>&lt;p&gt;Hello&lt;/p&gt;
&lt;p&gt;Will be glad if it helps you&lt;/p&gt;</description></item><item><title>Re: Auto-view selection on upload or similar</title><link>https://www.infopathdev.com:443/forums/thread/23383.aspx</link><pubDate>Tue, 02 Oct 2007 09:43:25 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:23383</guid><dc:creator>carlosthejackal</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/23383.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=40&amp;PostID=23383</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks for the prompt response, I&amp;#39;ll have a go it does look fairly straight forward.&lt;/p&gt;
&lt;p&gt;Once again cheers for the helping hand.&lt;/p&gt;
&lt;p&gt;Carl&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Auto-view selection on upload or similar</title><link>https://www.infopathdev.com:443/forums/thread/23377.aspx</link><pubDate>Tue, 02 Oct 2007 07:06:22 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:23377</guid><dc:creator>Kalyan Gaddam</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/23377.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=40&amp;PostID=23377</wfw:commentRss><description>&lt;p&gt;Hello&lt;/p&gt;
&lt;p&gt;Try this article and the logic in that&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.kbalertz.com/Q826997/Programmatically.Change.Default.Microsoft.Office.InfoPath.aspx"&gt;http://www.kbalertz.com/Q826997/Programmatically.Change.Default.Microsoft.Office.InfoPath.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I hope this is simple and will help you.&lt;/p&gt;</description></item><item><title>Auto-view selection on upload or similar</title><link>https://www.infopathdev.com:443/forums/thread/23376.aspx</link><pubDate>Tue, 02 Oct 2007 06:13:19 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:23376</guid><dc:creator>carlosthejackal</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/23376.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=40&amp;PostID=23376</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Hi Guys,&lt;/p&gt;&lt;p&gt;I know this old chestnut I know but I can not seem to find a post that explains easily how to do this....&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;br /&gt;Ideally I need this to be done without the use of code (as I am not that good at it)...&lt;/p&gt;&lt;p&gt;Ok here goes:&lt;/p&gt;&lt;p&gt; I have a field in the default view called &lt;b&gt;UserName&lt;/b&gt; this has a formula inserted U&lt;b&gt;serName()&lt;/b&gt;....this captures the user id, this is ok and is populated when the form is displayed.&lt;/p&gt;&lt;p&gt;In &lt;b&gt;Tools&amp;gt; Form Options&amp;gt;&amp;nbsp; Open and Save&lt;/b&gt; and &lt;b&gt;Default Behaviour&lt;/b&gt; I have an entry that states if&amp;nbsp; &lt;b&gt;UserName&amp;nbsp; is equal to (the users name)&lt;/b&gt;&amp;nbsp; switch view to a specific view.&lt;/p&gt;&lt;p&gt;Problem is it doesn&amp;#39;t - any idea&amp;#39;s?&lt;/p&gt;&lt;p&gt;Am I being to simplistic with this approach?&lt;/p&gt;&lt;p&gt;Thanks in advance.&lt;/p&gt;&lt;p&gt;Carl&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>