Abstract: When using infopath, sometimes we may need to put the form into a form library or B form library based on the choices of the person who filled in the form, that is, there is no way to save the document library in the form template. However, there is no way to continue without entering a save location when submitting a request. Fortunately, vsta allows you to change the location of the saved form library before submission.
- Create a template, for example,The submitted URLThis field can be entered by the user,"File NameThis field uses the current date as the file name for convenience:
- Create a submitted data connection. For example, the data connection name is:
Library or list, you can use the address of a document library instead, this address will be reset in vsta.
The file name can directly reference a domain, which is savefilename.
- Set the following vsta when "automatic submission"CodeThe system submits the form to the document library based on the submitted URL.
Public VoidCtrl3_5_clicked (ObjectSender,ClickedeventargsE)
{
// Write code here.
FilesubmitconnectionFSC = (Filesubmitconnection)This. Dataconnections ["Spsubmit"];
FSC. folderurl = maindatasource. createnavigator (). selectsinglenode ("/My: myfields/My: saveurl", Namespacemanager). value. tostring ();
FSC. Execute ();
}
The effect is as follows:
4. Create a digital signature for this form and publish it to the local hard disk. Then, upload the form from the management center to the server and activate it to the website set.