When designing a form, you can create a rule that automatically submits a form to a database, Web service, Microsoft Windows SharePoint Services library or list, or as an e-mail message, in response to an event. This event can include a change to a particular field or group in the data source (data source: The collection of fields and groups that define and store the data for an InfoPath form. Controls in the form are bound to the fields and groups in the data source.), the click of a button, the insertion of a repeating section (repeating section: A control on a form that contains other controls and that repeats as needed. Users can insert multiple sections when filling out the form.) or row in a repeating table (repeating table: A control on a form that contains other controls in a table format and that repeats as needed. Users can insert multiple rows when filling out the form.), or the opening of a form.
You can add multiple actions for each rule. For example, you can automatically update the value of a date field and then submit the form.
- In design mode, do one of the following:
In the Rules dialog box or on the Rules tab, click Add.
In the Name box, type a name for the rule.
To specify when the rule should run, click Set Condition, and then enter the condition. The rule will run when the event specified in step one occurs and the condition specified in this step is met.
Click Add Action.
In the Action list in the Action dialog box, click Submit using a data connection.
Do one of the following:
- To run the rule when a particular field or group in the data source is changed, open the Data Source task pane, double-click the field or group, and then click the Rules tab.
- To run the rule when the value of a control is changed, double-click the control, and then on the Data tab in the Control Properties dialog box, click Rules.
- To run the rule when the form is opened, click Form Options on the Tools menu, click the Open and Save tab, and then click Rules.
- To enable the form's default submit command to run the rule, click Submitting Forms on the Tools menu, and then click Enable Submit commands and buttons. In the Submit to list, click Custom submit using rules, and then click Rules.
- To run the rule when a button is clicked, double-click the button, click Rules and Custom Code in the Action list, and then click Rules.
If you want to prevent any rules from running after this rule (for the current event), select the Stop processing rules when this rule finishes check box in the Rule dialog box.
- If you have already added a data connection, click it in the Data connection list.
- To add a new data connection, click Add, and then follow the instructions in the Data Connection Wizard.
Note The information in this topic may not apply if you are working with a form designed using Microsoft Office InfoPath 2003 without the service pack installed.