Saving a form using a naming convention

S

Sabrina

I'm working on a form that I want the saved name to be created based on the
answers selected by the user. For example:
Year.monthday.BusinessUnit.EventType. I would also like the option to add an
(a),(b) etc., if there is duplication. I would like the file name to appear
in the form as well as a pop up at the end for the user to document. Please
help.
 
C

Clay Fox

I assume the components are all values in your form.
Best practice is to create a submit data connection that controls the saving
process. You would use the concatenation function to create the filename and
would set a location for the documents to be saved.
You could create a field for holding this file name and have it calculated
and displayed in your form and also in a alert message or where ever.
--
Thanks

Clay Fox

Qdabra Software
http://www.qdabra.com

InfoPathDev.Com
The Largest InfoPath Forum in the World
http://www.infopathdev.com
 
C

CK

Tell your submit button to perform a custom action using code.

Then in the code you have to do something like:

/// <summary>
/// Handles the Submit event of the FormEvents control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see
cref="Microsoft.Office.InfoPath.SubmitEventArgs"/> instance containing the
event data.</param>
public void FormEvents_Submit(object sender, SubmitEventArgs e)
{
WebServiceConnection submitConnection =
(WebServiceConnection)(DataConnections["Web Service Submit"]);
submitConnection.Execute();
string generatedName = GenerateName();
FileSubmitConnection submitSharepointConnection =
(FileSubmitConnection)(DataConnections["SharePoint Library Submit"]);
submitSharepointConnection.Filename.SetStringValue("YourTest" +
generatedName);
submitSharepointConnection.Execute();

e.CancelableArgs.Cancel = false;

}


Hope that helps.
 

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