How to close both the form and Infopath application with code? - InfoPath Dev
in

InfoPath Dev

How to close both the form and Infopath application with code?

Last post 09-08-2009 01:32 AM by princevis. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 09-01-2009 12:22 AM

    • Razor
    • Not Ranked
    • Joined on 02-01-2006
    • Posts 16

    How to close both the form and Infopath application with code?

    I.m using Infopath 2007 with the 2007 object model and managed C# code. I am saving the form using custom code and like to close the form and Infopath after save. The form close alright but the Infopath application is still running with the "Getting started" dialog on top. Could someone enlighten me on how to achieve this?

    The code I'm using:
    this.Close();
    I've also tried without different result:
    this.Application.ActiveWindow.Close();

    Regards Razor

  • 09-03-2009 12:20 AM In reply to

    Re: How to close both the form and Infopath application with code?

    Isn't there an Exit method?

    Patrick Halstead
    Project Manager at Qdabra
  • 09-07-2009 01:58 AM In reply to

    • Razor
    • Not Ranked
    • Joined on 02-01-2006
    • Posts 16

    Re: How to close both the form and Infopath application with code?

    Well, there might be one somewhere but I can't find it though.

  • 09-07-2009 02:04 AM In reply to

    Re: How to close both the form and Infopath application with code?

    If i'm not wrong,ur Save the form means submitting it to Form library.Right?
    Vishal Srivastava
    Senior Software Engineer
    SDG Software Pvt Ltd
  • 09-08-2009 12:57 AM In reply to

    • Razor
    • Not Ranked
    • Joined on 02-01-2006
    • Posts 16

    Re: How to close both the form and Infopath application with code?

    Exactly. My save function validates the form data, fetches an Id from a database using a stored procedure and then submits the form to a Sharepoint form library. The form closes alright but Infopath and that Getting started dialog opens up instead.

  • 09-08-2009 01:32 AM In reply to

    Re: How to close both the form and Infopath application with code?

    Instead of that create a data connection to submit data,to a sharepoint library,through some unique name,u can get now() function from the inbuilt formulas,then on button click do this

    SPSecurity.RunWithElevatedPrivileges(delegate()
                {
                    this.Submit();
                });

    Let me know,if u get it working..

    Vishal Srivastava
    Senior Software Engineer
    SDG Software Pvt Ltd
Page 1 of 1 (6 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.