Closing form by code opens "Fill out a form" wind - InfoPath Dev
in

InfoPath Dev

Closing form by code opens "Fill out a form" wind

Last post 02-28-2006 10:02 AM by Shiva. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 02-28-2006 06:25 AM

    Closing form by code opens "Fill out a form" wind

    Dear friends,
    On the click of a button,I submit data to multiple tables in database using webservice.Then an alert is displayed.On clicking OK button,the form is submitted to the SharePoint library and finally it closes.

    But the problem is that as soon as the form closes,the "Fill out a Form" window opens displaying the various form categories namely "Recently used forms,All forms,Favorites and so on.This window automatically opens.
    But I need to suppress this window.
    the code I write is


    string PRTrackingNumber=thisXDocument.DOM.selectSingleNode("/my:PR_Form/my:PRTrackingNumber").nodeTypedValue.ToString();

    thisXDocument.UI.Alert(PRTrackingNumber+" is the Procurement Request Tracking Number.You can use it to cancel your request.");


    //Finally Submit the Form to SharePoint Form Library
    DAVAdapter oSharePoint = (DAVAdapter)thisXDocument.DataAdapters["Submit"];
    oSharePoint.Submit();


    //Close
    thisApplication.XDocuments.Close(thisXDocument);

    Any help??
    Regards,
    Abhishek
  • 02-28-2006 06:41 AM In reply to

    Re: Closing form by code opens "Fill out a form" wind

    Also I tried using the Quit method.
    Infopath SDK clearly states that if the input argument is set to false,the Infopath application will be quit without saving i.e without prompting,even if the data in the form has been changed.
    But if I write the following code.....
    thisApplication.Quit(false);
    it prompts with the "Do you want to Save the form?" dialog.

    Any good peice of code to close the form.
    Regards,
    Abhishek.
  • 02-28-2006 10:02 AM In reply to

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

    Re: Closing form by code opens "Fill out a form" wind

    Hi Abhishek,

    //Close
    thisApplication.XDocuments.Close(thisXDocument);

    The above line in your code tries to close the present document, but does not close InfoPath window. If you want to close InfoPath window also use the following line of code

    thisApplication.ActiveWindow.Close(true);


    Hope this helps you
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.