Dynamic file nave for saving - InfoPath Dev
in

InfoPath Dev

Dynamic file nave for saving

Last post 06-15-2007 07:56 AM by romaik. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 06-15-2007 05:17 AM

    • romaik
    • Top 500 Contributor
    • Joined on 05-31-2007
    • Paris France
    • Posts 43

    Dynamic file nave for saving

    Hello

    I am currently working with InfoPath 2003 and I have a problem using a button.

    I created a button and its purpose is to save the form in a path with a name that contains data from a secondary data source.

     

    My code would be un JScrit (the default languge behind a button in fact) :

    function CTRL144_5::OnClick(eventObj) {

    XDocument.SaveAs("D:\\"+xdXDocument:GetDOM("observer")/observer/projet+".xml")

    }

     

    But it does not work. (If I put : XDocument.SaveAs("D:\\test.xml", it works)

     

    Any idea ?
     

    EDIT : observer is one of my secondary data source 

    InfoPath 2003 SP2 User
  • 06-15-2007 07:56 AM In reply to

    • romaik
    • Top 500 Contributor
    • Joined on 05-31-2007
    • Paris France
    • Posts 43

    Re: Dynamic file nave for saving

    First, i made a mistake in the thread title : it's name and not nave

     Second : I found the solution :

    "var path = "D:\\"

    path += XDocument.GetDOM("observer").selectSingleNode("//projet").text

    path += ".xml"

    XDocument.SaveAs(path)"

     

    I guess I could do it in one line, but I generally don't like overloaded lines :p
     

     

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