<?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>Views</title><link>https://www.infopathdev.com:443/forums/42.aspx</link><description> </description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Change view based on selection in another form</title><link>https://www.infopathdev.com:443/forums/thread/65357.aspx</link><pubDate>Tue, 22 Mar 2011 17:30:13 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:65357</guid><dc:creator>HelenW</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/65357.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=42&amp;PostID=65357</wfw:commentRss><description>&lt;p&gt;Hi Hilary...I did try the sample shown in that article.&amp;nbsp; Unfortunately, that article is using the OnLoad event and I&amp;#39;m back where I started...it passes 
the value after the project form has been opened and has already been 
loaded.&amp;nbsp; So it doesn&amp;#39;t work. &lt;br /&gt;&lt;/p&gt;&lt;p&gt;@leoffneym - the reason that I need separate forms is because each work request needs to be saved into a different doclib.&amp;nbsp; If I put all the project and work request information into one doclib, it&amp;#39;d be super huge.&amp;nbsp; If I use one form and submit to multiple libraries, there will be multiple versions of the project information floating around on each work request&amp;#39;s form.&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/p&gt;&lt;p&gt;I&amp;#39;m starting to think that I&amp;#39;m going to have to make the views in every form.&amp;nbsp; Surely there must be a better way!!! Any other ideas?&lt;/p&gt;&lt;p&gt; &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Change view based on selection in another form</title><link>https://www.infopathdev.com:443/forums/thread/65325.aspx</link><pubDate>Mon, 21 Mar 2011 17:10:41 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:65325</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/65325.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=42&amp;PostID=65325</wfw:commentRss><description>&lt;p&gt;That error was why I suggested changing the &lt;strong&gt;&lt;em&gt;default view&lt;/em&gt;&lt;/strong&gt; of the form. Did you read the script for the IP 2003 sample?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;XDocument.ViewInfos(&amp;quot;View 1&amp;quot;).IsDefault = true;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Change &amp;quot;View 1&amp;quot; for the name of the view you want to use.....&lt;/p&gt;</description></item><item><title>Re: Change view based on selection in another form</title><link>https://www.infopathdev.com:443/forums/thread/65314.aspx</link><pubDate>Mon, 21 Mar 2011 14:01:19 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:65314</guid><dc:creator>leoffneym</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/65314.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=42&amp;PostID=65314</wfw:commentRss><description>&lt;p&gt;The error is just saying either that the objXDoc form hasn&amp;#39;t loaded all the way when the SwitchView was called or the view wasn&amp;#39;t active when that line of code was called.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Is there any reason as to why you are using multiple forms instead of one form?&amp;nbsp; Just curious is all.&lt;/p&gt;
&lt;p&gt;If the SwitchView did not work, then unfortunately, I don&amp;#39;t think anything will.&amp;nbsp; To switch the view like you want, the form you are switching the view of has to be the active window.&lt;/p&gt;
&lt;p&gt;Sorry I couldn&amp;#39;t be of more help.&lt;/p&gt;</description></item><item><title>Re: Change view based on selection in another form</title><link>https://www.infopathdev.com:443/forums/thread/65312.aspx</link><pubDate>Mon, 21 Mar 2011 12:39:57 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:65312</guid><dc:creator>HelenW</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/65312.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=42&amp;PostID=65312</wfw:commentRss><description>&lt;p&gt;Thanks for the suggestions.&amp;nbsp; &lt;/p&gt;&lt;p&gt;I found that article that Hillary referenced before I posted and wasn&amp;#39;t sure how to translate it to work with the current code I&amp;#39;m using, since my code is in JScript&lt;br /&gt;&lt;/p&gt;&lt;p&gt;I tried using &lt;strong&gt;objXDoc.View.SwitchView(&amp;quot;Name of View&amp;quot;); &lt;/strong&gt;&lt;/p&gt;&lt;p&gt;and received the following error message:&amp;nbsp; &lt;/p&gt;&lt;p&gt;InfoPath cannot execute any view-related object model calls. The view is not ready.&lt;/p&gt;&lt;p&gt;I did a quick search for that error message and didn&amp;#39;t find anything that helped.&amp;nbsp; Any ideas how to tend that message?&amp;nbsp; Or another way to accomplish what I need to do? &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Change view based on selection in another form</title><link>https://www.infopathdev.com:443/forums/thread/65288.aspx</link><pubDate>Fri, 18 Mar 2011 17:57:34 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:65288</guid><dc:creator>leoffneym</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/65288.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=42&amp;PostID=65288</wfw:commentRss><description>&lt;p&gt;Have you tried setting the view after opening the new form, see below:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;var objXDoc;&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp; //open the project form &lt;/p&gt;
&lt;p&gt;objXDoc = Application.XDocuments.Open(FullPath); &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;objXDoc.View.SwitchView(&amp;quot;Name of View&amp;quot;);&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;//close the original form &lt;/p&gt;
&lt;p&gt;XDocument.View.Window.Close(true);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Or have you tried to set the view by using code with the field that has the view name in it.&lt;/p&gt;</description></item><item><title>Re: Change view based on selection in another form</title><link>https://www.infopathdev.com:443/forums/thread/65285.aspx</link><pubDate>Fri, 18 Mar 2011 15:32:43 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:65285</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/65285.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=42&amp;PostID=65285</wfw:commentRss><description>&lt;p&gt;You may need&amp;nbsp;to figure out a way to set the default view of the form. Perhaps this &lt;a href="http://support.microsoft.com/kb/826997"&gt;article&lt;/a&gt; will help you....&lt;/p&gt;</description></item><item><title>Re: Change view based on selection in another form</title><link>https://www.infopathdev.com:443/forums/thread/65281.aspx</link><pubDate>Fri, 18 Mar 2011 13:08:24 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:65281</guid><dc:creator>HelenW</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/65281.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=42&amp;PostID=65281</wfw:commentRss><description>&lt;p&gt;Anyone...?&lt;/p&gt;&lt;p&gt;If this can&amp;#39;t be done, does anyone have a suggestion of an alternate way of doing this? &amp;nbsp; &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Change view based on selection in another form</title><link>https://www.infopathdev.com:443/forums/thread/65188.aspx</link><pubDate>Tue, 15 Mar 2011 15:49:52 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:65188</guid><dc:creator>HelenW</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/65188.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=42&amp;PostID=65188</wfw:commentRss><description>&lt;p&gt;Hi - I am working on a set of forms that are all connected by a tabbed header (which is really a bunch of buttons).&amp;nbsp; There are 10 tabs: 1 project form with 9 work request forms.&amp;nbsp; Each work request will be associated with a project.&amp;nbsp; On the project form, each tab will show a list of associated work requests in line with the tab name (so for example, if you click on the Photography tab, you see all the photography requests associated with that project).&amp;nbsp; Once on the work request tab, you can click an edit button to edit a particular work request or create a new work request.&amp;nbsp; Both will open an existing work request form. When the Create New button is clicked, it will pass some values related to the project into the work request form, close the project form and open the work request form with that tab highlighted.&amp;nbsp; To our users, we are trying to make it look like the same form and so far I have all this working. &lt;/p&gt;&lt;p&gt;The struggle comes in when I am in the work request form and want to click on any tab (button) other than the project tab.&amp;nbsp; I have setup the project button to look at the associated project and pass the values so that it opens up the correct project form.&amp;nbsp; But I&amp;#39;d like the work requests tabs to bring me back to the project form and open it up to the view associated with the tab(button) that was just clicked.&amp;nbsp; Here is the code that I use for the project form (and it works just fine):&lt;/p&gt;&lt;p&gt;&amp;nbsp;	//submit the Work Request Form
	&lt;/p&gt;&lt;p&gt;XDocument.DataAdapters[&amp;quot;SharePoint Library Submit&amp;quot;].Submit();
 &lt;/p&gt;&lt;p&gt;	//set the path to the project library and form
	&lt;/p&gt;&lt;p&gt;var LibraryPath = &amp;quot;http://sharepointsite/Projects%20List/&amp;quot;;
	&lt;/p&gt;&lt;p&gt;var FormName = XDocument.DOM.selectSingleNode(&amp;quot;/my:myFields/my:gpIdentifiers/my:FormTitle&amp;quot;).text;
	&lt;/p&gt;&lt;p&gt;var FullPath = LibraryPath + FormName;
&lt;/p&gt;&lt;p&gt;	var objXDoc;&amp;nbsp;
&lt;/p&gt;&lt;p&gt;&amp;nbsp;	//open the project form
	&lt;/p&gt;&lt;p&gt;objXDoc = Application.XDocuments.Open(FullPath);
	
	&lt;/p&gt;&lt;p&gt;//close the original form
	&lt;/p&gt;&lt;p&gt;XDocument.View.Window.Close(true);&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;So for instance if I&amp;#39;m in Work Request Type A&amp;#39;s form and I click on the Work Request B button, I&amp;#39;d like it to open the project form and switch to the Work Request B view so I can see all associated work requests of type B.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;I created a field called ViewName, using the button to set the ViewName field to that of the desired view on the project form and passing that back to the project form.&amp;nbsp; I can get it to pass the ViewName in, by adding a line of code, but I cannot get it to switch views.&amp;nbsp; I tried adding an OnLoad event and that doesn&amp;#39;t work because it passes the value after the project form has been opened and has already been loaded.&amp;nbsp; I tried using form rules and the same thing happened. &lt;br /&gt;&lt;/p&gt;&lt;p&gt;Is there a way to do what I need to do?&amp;nbsp; I really don&amp;#39;t want to have to create the same views on 10 forms (yeah, I could create one and then re-save it 10 times, but that still seems like a lot of extra work, especially because I have to create each work request and publish it in order to get the fields from the work request to appear on the appropriate tab, so there will come a point where re-saving will not work and I&amp;#39;ll be editing 10 different forms the same way)&amp;nbsp; Or is there another way to approach this that I&amp;#39;m not thinking of? &amp;nbsp; &lt;/p&gt;&lt;p&gt;Any advice/suggestions would be great.&lt;/p&gt;&lt;p&gt;Thanks!&lt;/p&gt;&lt;p&gt;Helen &lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>