saveAs method

A

awz

what is the correct syntax to reference a field in my form so that i can have
that field as my form file name after i click a submitt button to save the
form.

currently my saveAs method looks like this:
function CTRL19_5::OnClick(eventObj)

XDocument.SaveAs(XDocument.DOM.selectSingleNode("/my:TimeSheetRoot/my:ClientName").text);
XDocument.UI.Alert("The file has been successfully saved.");
}

the error i get is that the "file path referred to by an object model call
must be aboslute." how can i make an absolute path reference?

thanks for any help you can give!

awz
 
B

Brian Teutsch [MSFT]

The path must include the drive letter, and be escaped. So the field you get
the path from must be like: "c:\\temp\\myFile.xml".

Brian
 
B

Brian Teutsch [MSFT]

You're mixing up XPath selectors and your SaveAs call. Select the path from
the XML first, then use concat() to prepend c:\\. Finally, use the SaveAs
method.

// won't work, not tested, this is the idea
var myPath = XDocument.DOM.selectSingleNode(dfs:myFields...);
// use regex to replace \ with \\ if you allow users to enter them
XDocument.SaveAs( concat("c:\\", myPath) );

Brian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top