<?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: Switchview before sending email</title><link>https://www.infopathdev.com:443/forums/thread/57497.aspx</link><pubDate>Fri, 30 Jul 2010 21:55:47 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:57497</guid><dc:creator>AzuDaioh</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/57497.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=42&amp;PostID=57497</wfw:commentRss><description>&lt;p&gt;Sorry for the late reply. I was pulled into doing something else. On this project, I ended up displaying another view before the user clicks the submit button. It works but not exactly what I wanted to do in the first place. Here is the OnClick function: &lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Sub SubmitID_OnClick(eventObj)&amp;nbsp;&lt;/p&gt;
&lt;p&gt;On Error Resume Next&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Dim objOutlook&lt;br /&gt;&amp;nbsp;Dim objOutlookMsg&lt;br /&gt;&amp;nbsp;Dim objOutlookRecip&lt;br /&gt;&amp;nbsp;Dim oFormType&lt;br /&gt;&amp;nbsp;Dim oLastName&lt;br /&gt;&amp;nbsp;Dim oFirstName&lt;br /&gt;&amp;nbsp;Dim oSendTo&lt;br /&gt;&amp;nbsp;Dim oCCTo&lt;br /&gt;&amp;nbsp;Dim oSPLink&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&amp;nbsp;set objOutlook = CreateObject(&amp;quot;Outlook.Application&amp;quot;)&lt;br /&gt;&amp;nbsp;set objOutlookMsg = objOutlook.CreateItem(0)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;with objOutlookMsg&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;oSendTo = XDocument.DOM.selectSingleNode(&amp;quot;//my:myFields/my:mySendTo&amp;quot;).text&lt;br /&gt;&amp;nbsp;&amp;nbsp;oCCTo = XDocument.DOM.selectSingleNode(&amp;quot;//my:myFields/my:myCCTo&amp;quot;).text&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;set objOutlookRecip = .Recipients.Add(oSendTo)&lt;br /&gt;&amp;nbsp;&amp;nbsp;objOutlookRecip.Type = 1&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;set objOutlookRecip = .Recipients.Add(oCCTo)&lt;br /&gt;&amp;nbsp;&amp;nbsp;objOutlookRecip.Type = 2&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;oFormType = XDocument.DOM.selectSingleNode(&amp;quot;//my:myFields/my:RefType&amp;quot;).text&lt;br /&gt;&amp;nbsp;&amp;nbsp;oLastName = XDocument.DOM.selectSingleNode(&amp;quot;//my:myFields/my:BasicGp/my:ClmtLastName&amp;quot;).text&lt;br /&gt;&amp;nbsp;&amp;nbsp;oFirstName = XDocument.DOM.selectSingleNode(&amp;quot;//my:myFields/my:BasicGp/my:ClmtFirstName&amp;quot;).text&lt;br /&gt;&amp;nbsp;&amp;nbsp;oSPLink = XDocument.DOM.selectSingleNode(&amp;quot;//my:myFields/my:SPLink&amp;quot;).text&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;.subject = oFormType &amp;amp; &amp;quot; referral for: &amp;quot; &amp;amp; oLastName &amp;amp; &amp;quot;, &amp;quot; &amp;amp; oFirstName&lt;br /&gt;&amp;nbsp;&amp;nbsp;.body =&amp;nbsp; oSPLink&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;For Each objOutlookRecip In .Recipients&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;objOutlookRecip.Resolve&lt;br /&gt;&amp;nbsp;&amp;nbsp;Next&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;.send&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;eventObj.ReturnStatus = true&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;end with&lt;br /&gt;End Sub&lt;/p&gt;&lt;/blockquote&gt;</description></item><item><title>Re: Switchview before sending email</title><link>https://www.infopathdev.com:443/forums/thread/57336.aspx</link><pubDate>Mon, 26 Jul 2010 13:06:01 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:57336</guid><dc:creator>mgarant</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/57336.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=42&amp;PostID=57336</wfw:commentRss><description>&lt;p&gt;Could you post the entire OnClick function? including the declaration?&lt;/p&gt;</description></item><item><title>Re: Switchview before sending email</title><link>https://www.infopathdev.com:443/forums/thread/57311.aspx</link><pubDate>Fri, 23 Jul 2010 20:27:47 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:57311</guid><dc:creator>AzuDaioh</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/57311.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=42&amp;PostID=57311</wfw:commentRss><description>Edit:
I&amp;#39;m sorry, i just found out the reason why it switched to &amp;quot;reminder&amp;quot; was because I had a rule to switchview.  After I removed this rule, the code above did nothing.  It didnt switch to &amp;quot;Reminder&amp;quot; before or after the 2 dialog boxes. 

----
&lt;p&gt;When the OnClick button is pressed. The OnClick button has rules and custom codes. The rules are used to set values in the SharePoint list based on the values on the form. Then the custom code I have the following, this is where the 2 dialog boxes appear:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;set objOutlook = CreateObject(&amp;quot;Outlook.Application&amp;quot;) &lt;br /&gt;set objOutlookMsg = objOutlook.CreateItem(0)&lt;/p&gt;
&lt;p&gt;set objOutlookRecip = .Recipients.Add(oSendTo) &lt;br /&gt;objOutlookRecip.Type = 1 &lt;br /&gt;&lt;br /&gt;set objOutlookRecip = .Recipients.Add(oSendCC) &lt;br /&gt;objOutlookRecip.Type = 2 &lt;/p&gt;
&lt;p&gt;.subject = &amp;quot;---&amp;quot;&lt;br /&gt;.body = &amp;quot;---&amp;quot;&lt;br /&gt;&lt;br /&gt;For Each objOutlookRecip In .Recipients &lt;br /&gt;objOutlookRecip.Resolve&lt;br /&gt;Next&lt;/p&gt;
&lt;p&gt;.send&lt;br /&gt;eventObj.ReturnStatus = true&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;&amp;nbsp;Thanks for helping out.&lt;/p&gt;</description></item><item><title>Re: Switchview before sending email</title><link>https://www.infopathdev.com:443/forums/thread/57310.aspx</link><pubDate>Fri, 23 Jul 2010 20:16:00 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:57310</guid><dc:creator>mgarant</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/57310.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=42&amp;PostID=57310</wfw:commentRss><description>&lt;p&gt;how and when do call the 2 dialog boxes?&lt;/p&gt;</description></item><item><title>Re: Switchview before sending email</title><link>https://www.infopathdev.com:443/forums/thread/57308.aspx</link><pubDate>Fri, 23 Jul 2010 20:10:56 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:57308</guid><dc:creator>AzuDaioh</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/57308.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=42&amp;PostID=57308</wfw:commentRss><description>&lt;p&gt;&lt;/p&gt;
Hello, It changed AFTER the 2 dialog boxes. Thanks

----
Edit: Sorry, the above response is inaccurate.  The switch didnt take place before or after.</description></item><item><title>Re: Switchview before sending email</title><link>https://www.infopathdev.com:443/forums/thread/57307.aspx</link><pubDate>Fri, 23 Jul 2010 19:33:09 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:57307</guid><dc:creator>mgarant</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/57307.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=42&amp;PostID=57307</wfw:commentRss><description>&lt;p&gt;Does it change the view AFTER the 2 dialog boxes? Or it doesn&amp;#39;t change at all?&lt;/p&gt;</description></item><item><title>Re: Switchview before sending email</title><link>https://www.infopathdev.com:443/forums/thread/57306.aspx</link><pubDate>Fri, 23 Jul 2010 19:21:08 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:57306</guid><dc:creator>AzuDaioh</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/57306.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=42&amp;PostID=57306</wfw:commentRss><description>&lt;p&gt;&lt;/p&gt;
Hello and thanks again.  I added those lines and still did the same. It didn&amp;#39;t change view until after the 2 dialog boxes.</description></item><item><title>Re: Switchview before sending email</title><link>https://www.infopathdev.com:443/forums/thread/57304.aspx</link><pubDate>Fri, 23 Jul 2010 18:34:58 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:57304</guid><dc:creator>mgarant</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/57304.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=42&amp;PostID=57304</wfw:commentRss><description>&lt;p&gt;The code I gave you is C#. I don&amp;#39;t know vb.net, but i think i know what the problem might be...&lt;/p&gt;
&lt;p&gt;if objDefaultView&amp;nbsp; = false Then&lt;br /&gt;&amp;nbsp;&amp;nbsp; XDocument.ViewInfos(&amp;quot;Main&amp;quot;).IsDefault = true&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;strong&gt; XDocument.ViewInfos(&amp;quot;Reminder&amp;quot;).IsDefault = false // Add this line&lt;/strong&gt;&lt;br /&gt;else&lt;br /&gt;&amp;nbsp;&amp;nbsp; XDocument.ViewInfos(&amp;quot;Reminder&amp;quot;).IsDefault = true&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;strong&gt;XDocument.ViewInfos(&amp;quot;Main&amp;quot;).IsDefault = false // Add this line&lt;/strong&gt;&lt;br /&gt;end if&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Maybe I&amp;#39;m wrong, but it is worth a try&lt;/p&gt;</description></item><item><title>Re: Switchview before sending email</title><link>https://www.infopathdev.com:443/forums/thread/57302.aspx</link><pubDate>Fri, 23 Jul 2010 18:23:52 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:57302</guid><dc:creator>AzuDaioh</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/57302.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=42&amp;PostID=57302</wfw:commentRss><description>&lt;p&gt;Thank you mgarant. &lt;/p&gt;
&lt;p&gt;I tried this too but I&amp;#39;m getting an error message regarding &amp;#39;e&amp;#39;...I think this code is for Jscript/infopath 2007? We are still using Infopath 2003 (sorry I forgot to mention in my original post). However, using this example I found something for infopath 2003 (http://support.microsoft.com/kb/826997) but the example is in jscript or was it c#. I tried converting it so vbscript. I got the defaultview to work on the OnLoad event but I can&amp;#39;t switch it to my &amp;quot;reminder&amp;quot; view.&amp;nbsp;I could be doing it wrong too. Here&amp;#39;s what I have:&lt;/p&gt;
&lt;p&gt;In my&amp;nbsp;Sub XDocument_OnLoad(eventObj), I have:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Dim objDefaultView
&lt;br /&gt;objDefaultView = XDocument.DOM.selectSingleNode(&amp;quot;//my:field1&amp;quot;)&lt;/p&gt;&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;if objDefaultView&amp;nbsp; = false Then&lt;br /&gt;&amp;nbsp;&amp;nbsp; XDocument.ViewInfos(&amp;quot;Main&amp;quot;).IsDefault = true&lt;br /&gt;else&lt;br /&gt;&amp;nbsp;&amp;nbsp; XDocument.ViewInfos(&amp;quot;Reminder&amp;quot;).IsDefault = true&lt;br /&gt;end if&lt;/p&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;
&lt;p&gt;The &amp;quot;field1&amp;quot; is a check box set to &amp;quot;false&amp;quot; by default.&amp;nbsp;&amp;nbsp; &lt;/p&gt;
&lt;p&gt;In my OnClick&amp;nbsp;button,&amp;nbsp;I added:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;XDocument.DOM.selectSingleNode(&amp;quot;//my:field1&amp;quot;).text = &amp;quot;true&amp;quot;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;This seems to check the field1 box but it doesn&amp;#39;t do anything.&amp;nbsp; It doesnt change the view before or after the 2 dialog boxes appeared. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;Any help or guidance is greatly appreciated. Thanks in advance.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Switchview before sending email</title><link>https://www.infopathdev.com:443/forums/thread/57301.aspx</link><pubDate>Fri, 23 Jul 2010 18:10:10 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:57301</guid><dc:creator>AzuDaioh</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/57301.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=42&amp;PostID=57301</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thank you&amp;nbsp;Hilary for the suggestions.&amp;nbsp; This gave me an idea for another project. But for the one I&amp;#39;m working on,&amp;nbsp;the&amp;nbsp;section&amp;nbsp;appeared after&amp;nbsp;I confirmed the 2&amp;nbsp;dialog boxes.&lt;/p&gt;
&lt;p&gt;When I click the &amp;#39;submit&amp;#39; button, it does the following: &lt;br /&gt;1) submit the data from the form onto a list on SharePoint &lt;br /&gt;2) sends an email automatically to the appropriate people using objOutlookmsg -- but this requires 2 dialog boxes to appear, the 1st is to allow access to Outlook and the 2nd box is to confirm sending the email automatically.&lt;/p&gt;
&lt;p&gt;What I would like to accomplish, hopefully, is to display a view/section (Reminder) before the 2 dialog boxes appears.&amp;nbsp; I can add an action in my rule to display a dialog box with expression but I&amp;#39;m hoping I can display a more colorful/bigger reminder. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;Thanks again. &lt;/p&gt;</description></item><item><title>Re: Switchview before sending email</title><link>https://www.infopathdev.com:443/forums/thread/57241.aspx</link><pubDate>Fri, 23 Jul 2010 13:22:48 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:57241</guid><dc:creator>mgarant</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/57241.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=42&amp;PostID=57241</wfw:commentRss><description>&lt;p&gt;Another way to do it is to add a hidden field in your form named something like DefaultView with the name of your default view as the default value. Then,&amp;nbsp;in the code, when the user sends the email, change the value of this field to the name of the view you want them&amp;nbsp;to see. On the OnLoad event of your form, change the default view for the value in this hidden field.&lt;/p&gt;
&lt;p&gt;e.SetDefaultView(&amp;quot;View 1&amp;quot;);&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Hope that helps&lt;/p&gt;</description></item><item><title>Re: Switchview before sending email</title><link>https://www.infopathdev.com:443/forums/thread/57229.aspx</link><pubDate>Fri, 23 Jul 2010 01:20:09 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:57229</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/57229.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=42&amp;PostID=57229</wfw:commentRss><description>&lt;p&gt;Rather than switch views before emailing (don&amp;#39;t know how it functions with code, but if you are using rules, you&amp;#39;ll get a blank email at best), add a section to your form&amp;#39;s main view, and put all the controls you want in your &amp;quot;Reminder&amp;quot; view in that section. Put all the other controls in the view in another section. Add a field to your form (or a secondary data source) -- call it something like &amp;quot;Emailing&amp;quot;. When the user clicks the button, set Emailing to true (or do that in your code). At the end of your code, set Emailing back to true. Conditionally format your sections so that the view you want in the email hides unless Emailing = true, and the view you want to usually show hides unless Emailing = false.&lt;/p&gt;</description></item><item><title>Switchview before sending email</title><link>https://www.infopathdev.com:443/forums/thread/57227.aspx</link><pubDate>Thu, 22 Jul 2010 23:46:59 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:57227</guid><dc:creator>AzuDaioh</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/57227.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=42&amp;PostID=57227</wfw:commentRss><description>&lt;p&gt;I&amp;#39;m very new to Infopath/vbscript. Please correct me if I&amp;#39;m wrong, I read somewhere that&amp;nbsp;infopath processes the rules first before the codes but I cannot switch view before the code processed. I have an onClick button with rules and custom codes. One of the rules is to switchview to &amp;quot;Reminder&amp;quot;. The code im using is to send an email using objOutlookMsg.&lt;/p&gt;
&lt;p&gt;But...how do I switchview first before the code is run?&amp;nbsp;I placed the switchview action at the very top of my rule and I even tried using XDocument.View.SwitchView(&amp;quot;Reminder&amp;quot;) at the first top of the code.&amp;nbsp;They dont seem to make a difference. &lt;/p&gt;
&lt;p&gt;We&amp;#39;ve been having trouble with Outlook so I would like the users to see the reminder first in case&amp;nbsp;Outlook is down.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Any help is appreciated.&amp;nbsp; Thanks!!&lt;/p&gt;</description></item></channel></rss>