Can Submit Close InfoPath? - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Can Submit Close InfoPath?

Last post 08-29-2007 08:04 AM by BAHMan. 13 replies.
Page 1 of 1 (14 items)
Sort Posts: Previous Next
  • 03-17-2006 01:47 PM

    Can Submit Close InfoPath?

    I would like Submit to not only close the form, but close InfoPath. This application seems to scare the bejesus out of people and I'd like them to not be left in the middle of it once they've filled out a form.

    Thanks!
  • 03-17-2006 02:05 PM In reply to

    Re: Can Submit Close InfoPath?

    When you select the Submitting Forms under Tools, click Enable Submit commands and buttons. Click Submit options, then select Close the form. When the form is published to the SharePoint library and your user uses "Fill Out This Form", after they click Submit, the form and application should close.
    Stephanie Cantwell / Test Manager
    Qdabra® Software / Streamline data gathering to turn process into knowledge

  • 03-18-2006 04:53 PM In reply to

    Re: Can Submit Close InfoPath?

    Thanks, Stephanie. Mine doesn't behave like that. If the user clicks "Fill Out This Form" from the forms library, they click Submit and the form is submitted and closed, but InfoPath is left open.

    Also, is there a way to code it so it would automatically close even if launched from within an email?

    Deb
  • 03-18-2006 05:19 PM In reply to

    Re: Can Submit Close InfoPath?

    Try this in vb.net:
    thisXDocument.Submit()
    thisXDocument.View.Window.Close(True)

    or for JScript:
    Application.ActiveWindow.Close(True);

    or VB Script
    Application.ActiveWindow.Close True


    Good luck!

    Stephanie Cantwell / Test Manager
    Qdabra® Software / Streamline data gathering to turn process into knowledge

  • 03-20-2006 06:50 AM In reply to

    Re: Can Submit Close InfoPath?

    Thanks, Stephanie. I tried this JS:
    Application.ActiveWindow.Close(True);

    but get this error:

    A run-time error has occurred . . .
    "True" is undefined
  • 03-20-2006 10:09 AM In reply to

    Re: Can Submit Close InfoPath?

    I am sorry, it should be a lower case "true".
    Stephanie Cantwell / Test Manager
    Qdabra® Software / Streamline data gathering to turn process into knowledge

  • 03-20-2006 10:12 AM In reply to

    • Shiva
    • Top 25 Contributor
    • Joined on 04-15-2005
    • India
    • Posts 694

    Re: Can Submit Close InfoPath?

    Hi CycleFitness,

    Try this one
    thisApplication.ActiveWindow.Close(true);

    Hope this helps you.
  • 03-20-2006 12:32 PM In reply to

    Re: Can Submit Close InfoPath?

    Well, take that back. My version didn't work. Neither did this:

    thisApplication.ActiveWindow.Close(true);

    Any other thoughts why mine wouldn't be working?

    Thanks!
  • 03-20-2006 12:35 PM In reply to

    Re: Can Submit Close InfoPath?

    Trying all options presented ... this one worked:

    Application.ActiveWindow.Close(true);

    Where can I find help on the object model and these types of commands? I have a subscription to safari.informit.com, and am reading Patrick Halstead's Developing Solutions with Microsoft InfoPath. Are there any other great resources I should know about other than this site?

    Thank you, everyone! I'm so excited.
  • 03-20-2006 12:49 PM In reply to

    Re: Can Submit Close InfoPath?

    thisApplication.ActiveWindow.Close(true) is for c#. The problem you had was due to the casing issue (and it's my fault, I had typo in my suggestion).

    The MSDN library is a good place to start:
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_2003_ta/html/odc_ancInfo.asp
    Stephanie Cantwell / Test Manager
    Qdabra® Software / Streamline data gathering to turn process into knowledge

  • 08-28-2007 02:11 PM In reply to

    • BAHMan
    • Not Ranked
      Male
    • Joined on 08-28-2007
    • Posts 2

    Re: Can Submit Close InfoPath?

    I am having the same problem.  I am not sure what is the issue.  I am using VBScript as my language.  I have a submit button that saves the info and closes the form.  The code below is all I have for the OnSaveRequest.  I am new to InfoPath and this site.

    Sub XDocument_OnSaveRequest(eventObj)

    ' Write the code to be run before saving here.

    eventObj.IsCancelled = eventObj.PerformSaveOperation

    ' Write the code to be run after saving here.

    Application.ActiveWindow.Close True

    eventObj.ReturnStatus = True

    End Sub

  • 08-29-2007 06:22 AM In reply to

    Re: Can Submit Close InfoPath?

    Hi BAHMan,

     I tried in both VB.Script and Java Script.

     In Java Script "true" is case sensitive where as in VB.Script it is not.

     Try these

    BLOCKED SCRIPT       Application.ActiveWindow.Close(true)

    BLOCKED SCRIPT   Application.ActiveWindow.Close(True) or Application.ActiveWindow.Close(true)

     

    Hope this will help you.

    B.Shiva Prasad
    InfoPath Dev,
    http://www.ggktech.com
    India
  • 08-29-2007 06:27 AM In reply to

    Re: Can Submit Close InfoPath?

    Hi BAHMan,

     

    InfoPath site converted the "J Script" and "VB Script" with no space in to BLOCKED SCRIPT.

    In Java Sript                    Application.ActiveWindow.Close(true)

    and in VB Script             Application.ActiveWindow.Close(True) or Application.ActiveWindow.Close(true)

     

    Hope this will help you..

    B.Shiva Prasad
    InfoPath Dev,
    http://www.ggktech.com
    India
  • 08-29-2007 08:04 AM In reply to

    • BAHMan
    • Not Ranked
      Male
    • Joined on 08-28-2007
    • Posts 2

    Re: Can Submit Close InfoPath?

    I tried all that before.  I was just wondering if I could be blocked from running the code?  Or if the submit button actions trumped the code.

     

Page 1 of 1 (14 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.