The following information about the SharePoint site and list which will be updated when the form is submitted is required: The internal field names of the columns in the SharePoint list which are being updated are used in a CAML query to identify a column rather than the its display name. If the names of two or more columns are greater than 32 characters long and are identical if ignoring any character after the first 32, a number is appended to the field identifier to make each field unique.
Note the incrementing number at the end of each field identifier, which ensures that each field is unique. See below for an instructions and an example of one of it's many uses. Things to know about this CAML template plus some general info The command for the method is "Update", indicating that an item from a list is to be updated. The Batch element can have more than one Method element, but each must have a unique ID attribute value.
This can be used to match a response or error to the method which instigated it. The field element the the name attribute "ID" is used to find the item in the SharePoint list to be updated.
Save the following as a. See instructions below for using U2U to obtain the required field identifiers if required. I also use the tool to determine the correct identifier for each field in a particular list. Select the SharePoint list or library from the list of options. Select the fields which you will be submitting data to, then check the "Order By" box for each.
The name values for each FieldRef element are the required identifiers for each of the corresponding fields in the SharePoint list. Select "Access the data from the specified location" to enable changes to the CAML template to be made easily. Check "Store a copy of the the data for offline use" to ensure the CAML template is available when the xml file is not. Type a name for the Data Connection, leave "Automatically retrieve data when form is opened" checked and select finish.
Enter the address to the lists. Select "UpdateListItems" from the list of options. At this point, you have added the secondary data connection to store the CAML data, and a connection to submit the data to SharePoint. All fields in the CAML template above use the same "Field" element distinguished by a "name" attribute.
Event handlers On After Change events can be set for fields on the form or data source to pass the CAML data source field name and the XPATH to the field containing the required value to a function, with updates the required element based on the name attribute. From the Tools menu, select Submit Options Tick "Allow users to submit this form", Leave "Send form to a single destination" selected if you are only submitting using a single data connection.
If you are submitting using multiple data connections, select "Perform custom action using rules", then create a separate rule to submit each of the required data connections. If using rules, please ignore the steps below. Select "Web Service" from the list if options Select the web service data connection created in Step 4 when asked to choose a data connection for submit Press Ok Set up the Form to Submit to the Web Service Programmatically: When submitting data from an InfoPath from using multiple data connections, it can be useful to submit each data connection programmatically, as it gives you more control over the entire process.
The code used in this example is JScript. OnSubmitRequest if using JScript for the form code. Replace "WebServiceDataConnection" with the name of the web service data connection.