Change File Save As Name

D

D

I am trying to change the name given to a form when it is save from the
default "Form 1" to a field in my form.

I copied code that was posted on this site by Koen Alleman (thank you),
plugged in my forms file names, but the save name is still "Form1"

I entered this code by going through Form Options- Open and Save- Save using
Custom Code- Edit.

If there is anyone who can tell me what I have done wrong I would greatly
appreciate it. Thank you!

Here is my code:
function XDocument::OnSaveRequest(eventObj)
{function XDocument::OnSaveRequest(eventObj)
{
var nodeselname =
XDocument.DOM.selectSingleNode("/my:Intro:my:position/my:last_name_candidate").text
XDocument.UI.SetSaveAsDialogFileName(nodeselname);
XDocument.UI.SetSaveAsDialogLocation("C:\\temp\\");

eventObj.IsCancelled = eventObj.PerformSaveOperation();

XDocument.UI.Alert("Form saved");

eventObj.ReturnStatus = true;
}


// Write the code to be run before saving here.
 
D

D

Thank you for your help. I have yet another question. I know this seems so
basic but I don't think I am getting it right. How do I figure out what the
address (?) of the fieldI want to use to plug into the code.

I am trying to use a text box that is in a group that is in the data source.

Can you tell me the format.
Is it:
my::my:data source name/my:group name/my:field name

Thank you again!
-Denise
 

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