Submits on different Views Create Multiple Form Instances/Closing InfoPath - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Submits on different Views Create Multiple Form Instances/Closing InfoPath

Last post 12-05-2008 10:20 PM by Shiva. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 12-04-2008 12:50 PM

    • Steph
    • Not Ranked
    • Joined on 11-25-2008
    • Posts 4

    Submits on different Views Create Multiple Form Instances/Closing InfoPath

    Infopath 2003

    I have a form with multiple views (for different user roles), and each view has a submit button. The form is on SharePoint.

    I need the InfoPath application to close when users submit the form. I can do this by making the button control work through code that submits the filled-out form first then closes the InfoPath application.

    The problem is that every submit creates a new instance of the form, with a new ID and a new entry in the SharePoint form library.

    Regular old button controls set to use the submit action (no scripting) don't do that, but they also don't close InfoPath. I tried closing InfoPath using the OnSubmitRequest event, but nothing happens. And I don't see a way to add code to the regular old button control that submits.

    I also tried submitting using button rules, but I still get a new form for each submit.

    Making the form fully trusted so I can save on subsequent views instead of submitting is not a viable option. And neither is saving from the file menu because it doesn't enforce required fields.

    Do I have to ignore my users' requirement to close InfoPath?

    Thanks, Steph

    p.s., I'm not a programmer

  • 12-04-2008 08:37 PM In reply to

    Re: Submits on different Views Create Multiple Form Instances/Closing InfoPath

    Hi,

    You can submit the form and close the form by putting the rules on the submit button.

    1. Add a submit connection using sharepoint library.

    2. Place the value or field that should be shown as File name.

    3. Check the ‘Allow overwrite if file exists' check box.

    4. Go to button properties.

    5. Select ‘Submit' in Action drop down.

    6. Click on submit options button and choose the data connection which is taken above.

    7. Click Submit options button and select ‘Close the Form'. Click ok to close all the windows.

    8. Do the same for all the buttons.

    Swathip
    www.ggktech.com
  • 12-05-2008 05:49 AM In reply to

    • Steph
    • Not Ranked
    • Joined on 11-25-2008
    • Posts 4

    Re: Submits on different Views Create Multiple Form Instances/Closing InfoPath

     

    Thanks, but 'Close the Form' only closes the filled-out form; it does not close the InfoPath application.

     Steph

  • 12-05-2008 08:55 PM In reply to

    Re: Submits on different Views Create Multiple Form Instances/Closing InfoPath

    Hi,

    Use the following code line to close the infopath application.

    XDocument.View.Window.Close(true);

    Swathip
    www.ggktech.com
  • 12-05-2008 10:20 PM In reply to

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

    Re: Submits on different Views Create Multiple Form Instances/Closing InfoPath

    Hi,

    Here is the code will work to close the Infopath2007 form.

    this.Application.ActiveWindow.Close();

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