<?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>Newbie Questions</title><link>https://www.infopathdev.com:443/forums/39.aspx</link><description>New to InfoPath? Search to see if your question has already been answered. If it has not, then ask it here or the appropriate topic forum.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Close Infopath after submit does not work.</title><link>https://www.infopathdev.com:443/forums/thread/48079.aspx</link><pubDate>Wed, 21 Oct 2009 12:13:49 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:48079</guid><dc:creator>Svetoslav</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/48079.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=48079</wfw:commentRss><description>&lt;p&gt;Hi, &lt;/p&gt;
&lt;p&gt;I am using the Application.ActiveWindow.Close(true) functionality to close a&amp;nbsp;form after it is submitted. Fot 99% of the cases it works just perfect. But very rarely it happens that it shows me the following error: &lt;em&gt;&lt;strong&gt;Application.ActiveWindow is NULL or it is not an Object&lt;/strong&gt;&lt;/em&gt; (the messsage can be not the same as the original one, but this is a translation from German). Can someone explain&amp;nbsp; me what does it mean and where is the source, which can provoke this error. Thank you in advance. &lt;/p&gt;
&lt;p&gt;Regards, &lt;/p&gt;
&lt;p&gt;Svetoslav &lt;/p&gt;</description></item><item><title>Re: Close Infopath after submit does not work.</title><link>https://www.infopathdev.com:443/forums/thread/3390.aspx</link><pubDate>Tue, 05 Dec 2006 10:58:09 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:3390</guid><dc:creator>Sam </dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/3390.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=3390</wfw:commentRss><description>I have figured the email submit and how to submit to the sharepoint library. But I get an object error if i try to submit both using the same button. Either one only works.&lt;br /&gt;&lt;br /&gt;Also how can i add more forms in my code.  I know we use the .Open function. If anyone has anyclues. let me know.&lt;br /&gt;&lt;br /&gt;Thanks..</description></item><item><title>Re: Close Infopath after submit does not work.</title><link>https://www.infopathdev.com:443/forums/thread/3389.aspx</link><pubDate>Tue, 05 Dec 2006 10:52:49 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:3389</guid><dc:creator>ilse</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/3389.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=3389</wfw:commentRss><description>But if you make a button, using that custom code but with the OnClick, adding a rule to submit using the main submit (which in your case is an email connection)you should be fine. It will submit on clicking the button to email and close the program when it is send.</description></item><item><title>Re: Close Infopath after submit does not work.</title><link>https://www.infopathdev.com:443/forums/thread/3388.aspx</link><pubDate>Mon, 04 Dec 2006 07:28:10 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:3388</guid><dc:creator>Sam </dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/3388.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=3388</wfw:commentRss><description>Hi,&lt;br /&gt;&lt;br /&gt;I am using the following code, but it gives me an error on Submit request. I dont want to use the Main submit. I want to be able to submit using the submit button.&lt;br /&gt; &lt;br /&gt;function XDocument::OnSubmitRequest(eventObj)&lt;br /&gt;{ &lt;br /&gt;if (XDocument.Errors.Count &amp;gt; 0) &lt;br /&gt;{XDocument.UI.Alert("Required information is missing as indicated by the red asterisk(s).") ; &lt;br /&gt;return; &lt;br /&gt;} &lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;XDocument.Submit() &lt;br /&gt;Application.ActiveWindow.Close(true);&lt;br /&gt;}&lt;br /&gt;catch(e)&lt;br /&gt;{&lt;br /&gt;XDocument.UI.Alert(e.description);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;I would like to submit using an Email data connection.&lt;br /&gt;Will the following code work and where should i place it?&lt;br /&gt;&lt;br /&gt;string submitDestination =  XDocument.DOM.selectSingleNode("my email address");    &lt;br /&gt;EmailAdapter emailSubmit = (EmailAdapter)thisXDocument.DataAdapters["EmailSubmit"];&lt;br /&gt;emailSubmit.Submit();&lt;br /&gt;&lt;br /&gt;Thanks for any help!!!!</description></item><item><title>Re: Close Infopath after submit does not work.</title><link>https://www.infopathdev.com:443/forums/thread/3387.aspx</link><pubDate>Fri, 17 Nov 2006 14:57:24 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:3387</guid><dc:creator>CycleFitness</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/3387.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=3387</wfw:commentRss><description>Yeah!&lt;br /&gt;&lt;br /&gt;I posted on the Microsoft Dev forum a little bit of knowledge I didn't know previously.  Here's how I implemented it:&lt;br /&gt;&lt;br /&gt;1.  I diagrammed the worklfow and identified five states of processing.   &lt;br /&gt;2.  I created all my fields and layout, placing them in Sections related to each state of processing.&lt;br /&gt;3.  I coded each of the sections with Conditional Formatting to Hide or Disable controls depending on the currrent state.&lt;br /&gt;4.  I coded the "Submit" buttons in those sections with Rules to set the State field after each submit.  There is also code behind each button similar to what you put in your last post; i.e., a generic Submit.&lt;br /&gt;&lt;br /&gt;Now here is what I didn't know at first, but later found out.  The Submit rules that you set up in Tools...Submitting Forms with &lt;i&gt;Submit To&lt;/i&gt; set to "Custom submit using rules"  are processed AFTER each of the generic Submit statements in the controls.  So . . . I set those rules to submit to the appropriate data connection depending on the value of the State field.  It's amazing how easy it is once you know what you're doing. ;-)&lt;br /&gt;&lt;br /&gt;I now need a couple of things: &lt;br /&gt;&lt;br /&gt;1.  A simple routine to trap a failed submission and give control back to the user.  &lt;br /&gt;2.  A simple piece of code that sets the value of the State field AFTER successful submission.  Right now, I'm setting in the Rules of the Submit button, so if the Submit fails that field is erroneously saying it was submitted.</description></item><item><title>Re: Close Infopath after submit does not work.</title><link>https://www.infopathdev.com:443/forums/thread/3386.aspx</link><pubDate>Fri, 17 Nov 2006 11:31:26 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:3386</guid><dc:creator>ilse</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/3386.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=3386</wfw:commentRss><description>Succes !!! In my button I made a rule in my Rules and Custom code to use the main submit, edited the code like below and it works. I even got me a little success message. When I add a failure message the same way but with false it pops up right after the success one ( yes yes very funny :) )&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;function CTRL1_5::OnClick(eventObj)&lt;br /&gt;{ &lt;br /&gt;if (XDocument.Errors.Count &amp;gt; 0)   &lt;br /&gt;{XDocument.UI.Alert("Required information is missing.")    &lt;br /&gt;return;&lt;br /&gt;}&lt;br /&gt;if (eventObj.ReturnStatus = true);&lt;br /&gt;{XDocument.UI.Alert("Form was uploaded succesfully.");&lt;br /&gt;}&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;Application.ActiveWindow.Close(true);&lt;br /&gt;}&lt;br /&gt;catch(e)&lt;br /&gt;{&lt;br /&gt;XDocument.UI.Alert(e.description);&lt;br /&gt;}&lt;br /&gt;}</description></item><item><title>Re: Close Infopath after submit does not work.</title><link>https://www.infopathdev.com:443/forums/thread/3385.aspx</link><pubDate>Fri, 17 Nov 2006 09:24:20 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:3385</guid><dc:creator>ilse</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/3385.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=3385</wfw:commentRss><description>No just 1 dataconnection. I made a new test form with only 1 button to just try and make this program close happen. If I just enable the sumbit to sharepoint via the submit button and add that code as OnSubmitRequest in Script editor it just leaves the form open but submits. If i change the submit to to custom submit with codes and add that code there, it closes just fine but does not submit. I presume I need to specify the whole submit routine. So I am searching for a custom submit code to SharePoint so I can add your code to it.</description></item><item><title>Re: Close Infopath after submit does not work.</title><link>https://www.infopathdev.com:443/forums/thread/3384.aspx</link><pubDate>Wed, 15 Nov 2006 16:35:48 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:3384</guid><dc:creator>CycleFitness</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/3384.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=3384</wfw:commentRss><description>That submits for me.  I wonder if you have a number of data connections, which one it uses by default?  I haven't attempted it in the current form I'm working on that has six (count 'em 6!) data connections.  It's a workflow solution with multiple email submits.&lt;br /&gt;&lt;br /&gt;I hope someone here can help us with a solution.  I guess 2007 will help with this, but our company is at least a year away from that.  We're not early adopters.</description></item><item><title>Re: Close Infopath after submit does not work.</title><link>https://www.infopathdev.com:443/forums/thread/3383.aspx</link><pubDate>Wed, 15 Nov 2006 16:30:02 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:3383</guid><dc:creator>ilse</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/3383.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=3383</wfw:commentRss><description>Hi deb, I just read your whole post on the community about that and when I use that code it closed the program just fine, but I want it to submit something to my SharePoint too and it does not do that anymore. I need to write a custom submit code I presume, but I am not up to speed in doing that yet. &lt;br /&gt;&lt;br /&gt;I am actually having fun now trying to figure it out. If only I could combine the build-in submit to SharePoint and this closing code we'de be done.</description></item><item><title>Re: Close Infopath after submit does not work.</title><link>https://www.infopathdev.com:443/forums/thread/3382.aspx</link><pubDate>Wed, 15 Nov 2006 16:20:09 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:3382</guid><dc:creator>CycleFitness</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/3382.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=3382</wfw:commentRss><description>ilse:&lt;br /&gt;&lt;br /&gt;Here is the code I got from the good people on the Microsoft forum.  Put this in in the code of a submit button.  It first checks to be sure all required fields have values.  It then attempts to submit.  &lt;br /&gt;&lt;br /&gt;What I'm waiting for is a way to specify which data connection to submit to.  Then, this code will be perfect for me.  In the meantime, it does close InfoPath after submit.&lt;br /&gt;&lt;br /&gt;{ &lt;br /&gt;if (XDocument.Errors.Count &amp;gt; 0)   &lt;br /&gt;{XDocument.UI.Alert("Required information is missing as indicated by the red asterisk(s).") ;   &lt;br /&gt;return;    &lt;br /&gt;} &lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;XDocument.Submit() &lt;br /&gt;Application.ActiveWindow.Close(true);&lt;br /&gt;}&lt;br /&gt;catch(e)&lt;br /&gt;{&lt;br /&gt;XDocument.UI.Alert(e.description);&lt;br /&gt;}&lt;br /&gt;</description></item><item><title>Re: Close Infopath after submit does not work.</title><link>https://www.infopathdev.com:443/forums/thread/3381.aspx</link><pubDate>Tue, 07 Nov 2006 09:28:46 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:3381</guid><dc:creator>ilse</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/3381.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=3381</wfw:commentRss><description>I presume you mean that I implement it into my existing code making it :&lt;br /&gt;&lt;br /&gt;function XDocument::OnSubmitRequest(eventObj)&lt;br /&gt;{&lt;br /&gt;XDocument.View.Window.Close(true);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;And that does not work. It only closes the window, but thanks a lot. I appreciate all help I can get.</description></item><item><title>Re: Close Infopath after submit does not work.</title><link>https://www.infopathdev.com:443/forums/thread/3380.aspx</link><pubDate>Tue, 07 Nov 2006 06:15:30 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:3380</guid><dc:creator>Suresh Reddy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/3380.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=3380</wfw:commentRss><description>Hi,&lt;br /&gt;&lt;br /&gt;please try out this &lt;br /&gt;XDocument.View.Window.Close(true)&lt;br /&gt;Hope this will help you.&lt;br /&gt;</description></item><item><title>Re: Close Infopath after submit does not work.</title><link>https://www.infopathdev.com:443/forums/thread/3379.aspx</link><pubDate>Mon, 06 Nov 2006 16:02:14 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:3379</guid><dc:creator>ilse</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/3379.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=3379</wfw:commentRss><description>Hi Patrick and thanks for responding.&lt;br /&gt;&lt;br /&gt;I have searched for "exit" and to my knowledge tried all kinds of variations to the theme. Like I said as far as I can see, my submit button code in closing the form overrules my exit codes. I am getting quite handy in making different kinds of forms, but the coding and Jscript part is just not my cup of tea. I am more of a software using type of girl, although I am learning simply by doing. Could you provide me with a simple script for me to build on?&lt;br /&gt;&lt;br /&gt;Thanks so much.</description></item><item><title>Re: Close Infopath after submit does not work.</title><link>https://www.infopathdev.com:443/forums/thread/3378.aspx</link><pubDate>Thu, 02 Nov 2006 16:02:39 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:3378</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/3378.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=3378</wfw:commentRss><description>Hi Ilse and welcome to our forum,&lt;br /&gt;This code will close the window but not the InfoPath instance. To do that, you'll want the code that does an "Exit". Search for exit and tell me if you don't find something. We're here for you! :)</description></item><item><title>Re: Close Infopath after submit does not work.</title><link>https://www.infopathdev.com:443/forums/thread/3377.aspx</link><pubDate>Thu, 02 Nov 2006 14:32:47 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:3377</guid><dc:creator>ilse</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/3377.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=3377</wfw:commentRss><description>Nobody ? I realise I am a newbie and to some of you this must be easy to solve, but I am going mad trying to figure out how to counter it. I am not experienced in either InfoPath or writing Jscript, but learning as I go along and trying to solve this has been a harsh tutor.&lt;br /&gt;&lt;br /&gt;I believe that the submit code of closing the form overrules my code of closing the program. I just do not know how to change it.</description></item></channel></rss>