Simple SaveAs and Close - InfoPath Dev
in

InfoPath Dev

Simple SaveAs and Close

Last post 04-28-2006 11:40 PM by Agni Jonnalagadda. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 04-28-2006 10:56 AM

    Simple SaveAs and Close

    I am trying to create a button on a form that would simply save the document and close it. I was trying this:

    XDocument.SaveAs(XDocument.ProjectName.valueOf())
    Application.XDocuments.Close(XDocument)

    Where ProjectName is a field on my form. I was trying to pass the value of the ProjectName field to the SaveAs method so that the form was saved with the file name set to the project name.

    Any help would be appreciated.
  • 04-28-2006 11:16 AM In reply to

    Re: Simple SaveAs and Close

    Hi Haver,
    Welcome to the Forum!
    In InfoPath you cannot refer to controls that are there in the UI Direcly from the code.
    In InfoPath controls are bound to XML fields and you get data from the XML fields and use them in the code.

    for ex:
    XDocument.DOM.selectSingleNode("/my:myFields/my:ProjectName").text;

    This line will get data from the XML for you.
  • 04-28-2006 01:12 PM In reply to

    Re: Simple SaveAs and Close

    We are using the InfoPath form to populate a SharePoint list. Does InfoPath save the value temporarily in XML until it is saved?
  • 04-28-2006 11:40 PM In reply to

    Re: Simple SaveAs and Close

    Yes.
    In InfoPath all values that are shown in the UI are stored somewhere in the XML, it can be in Main Dom or a secondary Dom.

    You can right click on the control and click "Show Datasource" then you will see the source if the data for that control in the taskpane.
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.