简体   繁体   English

如何在infoPath中创建提交按钮到SPoint2013

[英]How To create a submit button in infoPath to SPoint2013

I have an InfoPath web-based form running on InfoPath Forms Services in SharePoint. 我在SharePoint中的InfoPath Forms Services上运行了一个基于Web的InfoPath表单。 I want to be able to submit this form to a SharePoint form library and then use the data in the form to send an email. 我希望能够将此表单提交到SharePoint表单库,然后使用表单中的数据发送电子邮件。 After submitting the form and sending the email, I want the form to close the InfoPath form programmatically. 提交表单并发送电子邮件后,我希望该表单以编程方式关闭InfoPath表单。

1) In InfoPath, design a browser-compatible InfoPath form template 1)在InfoPath中,设计与浏览器兼容的InfoPath表单模板

2) On the Data Source task pane, add a Text Field node named formName under the myFields node. 2)在“数据源”任务窗格上,在myFields节点下添加一个名为formName的文本字段节点。

3) On the Tools menu, choose Data Connections. 3)在“工具”菜单上,选择“数据连接”。 On the Data Connections dialog box, click Add, and create a new Submit data connection As an e-mail message. 在“数据连接”对话框上,单击“添加”,然后创建一个新的“将数据连接作为电子邮件提交”。 Fill in any email address in the To field; 在“收件人”字段中填写任何电子邮件地址; you will be changing this in code anyway. 您仍将在代码中对此进行更改。 Accept the default name of Email Submit for the data connection. 接受用于数据连接的电子邮件提交的默认名称。

4) On the Data Connections dialog box, click Add, and create a new Submit data connection To a document library on a SharePoint site. 4)在“数据连接”对话框上,单击“添加”,然后创建一个新的“将数据连接到SharePoint网站上的文档库”。 Fill in a valid URL to a Document Library. 填写有效的文档库网址。 Select the formName node from the Main data source to be the File name for the form. 从主数据源中选择formName节点作为表单的文件名。 Accept the default name of SharePoint Library Submit for the data connection. 接受用于数据连接的SharePoint库提交的默认名称。

5) On the Tools menu, choose Submit Options. 5)在“工具”菜单上,选择“提交选项”。

6) On the Submit Options dialog box, select Allow users to submit this form, deselect the Show the Submit menu item and the Submit toolbar button check box, click Advanced and select Close the form from the After submit drop-down list box, select Perform custom action using Code, and click Edit Code. 6)在“提交选项”对话框中,选择“允许用户提交此表单”,取消选中“显示提交菜单”项和“提交工具栏”按钮复选框,单击“高级”,然后从“提交后”下拉列表框中选择“关闭表单”,选择使用代码执行自定义操作,然后单击编辑代码。

This will add a FormEvents_Submit event handler to the InfoPath form template. 这会将FormEvents_Submit事件处理程序添加到InfoPath表单模板。

In Microsoft Visual Studio Tools for Applications, add the following C# code to the FormEvents_Submit event handler: 在Microsoft Visual Studio Tools for Applications中,将以下C#代码添加到FormEvents_Submit事件处理程序中:

click here 点击这里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM