FAQs / InfoPath Integration |
To provide instructions for customizing the document file name when submitting an InfoPath form to SharePoint.
After enabling the Submit button, you can customize the naming convention of the form by modifying the AgilePointSumbitAndClose() function using the built in Microsoft Script Editor in InfoPath.
The script that is executed when the Submit button is selected is:
function XDocument::OnSubmitRequest(eventObj) { try { eventObj.ReturnStatus = true; AgilePointSubmitAndClose(); } catch(e) { eventObj.ReturnStatus = false; } }
CreateInfoPathForm("","","");
The CreateInfoPathForm function definition is:
CreateInfoPathForm(strFileNamePrefix, strDateFormat, strNumberFormat)
You can see that this function is being called with empty strings as parameter values. This will use the default file name format.
If you want to specify your own format, pass your own values to this function.
For example, if you want the file name prefix to be determined by the value of a data element on the form, you can call the function like this:
var docPrefix = XDocument.DOM.selectSingleNode "/my:myFields/my:myDataField").text; CreateInfoPathForm(docPrefix,"","");