Updating Records

Applies to: SharePoint Workspace 2010 | Visual Studio 2008

The UpdateRecords operation updates the records specified in the Forms2RecordDataSet.

When you call the UpdateRecords operation, the Schema element should describe the structure of the Data element. The RecordURI field identifies the record that is being updated. The operation updates all fields that are specified in the Data and leaves all omitted fields unchanged. You can update the _Editors and _Readers system fields. If you specify any other system fields, the values are ignored.

To update an attachment field, you must include both the attachment field and the attachment contents in the message. If both the attachment field and contents are included in the message, all files currently attached to the field are replaced by the attachment and contents specified in the message. If there are multiple files attached to a field, it is not possible to update one without updating all. It is not possible to update the name of an attachment without updating the contents. Note that if you read or query records and specify a false value for IncludeFileAttachmentContent, the returned RecordDataSet does not have the attachment contents. Consequently, if you update the values in but do not add contents to the RecordDataSet and then use it in a call to UpdateRecords, the attachment fields will be left unchanged.

If you convert from an ADO .NET DataSet to a Forms2RecordDataSet, the attachment contents are specified in the Forms2RecordDataSet if the row in the .NET DataSetFileDescriptor table has a child record in Contents table.

The forms designer can impose constraints on the values that the user can enter on forms. The designer can define constraints for form fields or can create custom constraints in forms script code. The constraints that are defined on a form field are applied when you call UpdateRecords. If any updated record fails any constraint, the UpdateRecords operation fails and no records are updated. In contrast, any constraints defined by the forms designer in script code are not applied when you call UpdateRecords. It is the responsibility of the Groove Web Services application developer to be aware of these constraints when updating a Forms tool through UpdateRecords.

If the form designer specifies in the form options that old versions of records should be saved, then UpdateRecords saves the old version of the record as a child to the updated record. The saved old version is assigned a new Record ID. The updated parent record retains the existing Record ID.

To call UpdateRecords successfully, the identity specified in the GrooveHeader object must have update permission for all records specified in the Forms2RecordDataSet.

Updating records in the InfoPath Forms tool has different requirements than updating records in the Groove Forms tool. In the InfoPath Forms tool, the InfoPath XML document that describes the entire record is stored in the Forms_Tool_IPContents attachments field. If you are updating records, you may specify the new values either by individual designer-defined fields or by the InfoPath XML document. If the record has a value for the Forms_Tool_IPContents field, it is used to update the record and any other designer-defined field values will be ignored. If the record does not have a value for the Forms_Tool_IPContents field, then the individual fields are updated based on each field's value in the record. If specified, the value in this field must be a valid InfoPath X-document for the tool's InfoPath template. In addition to conforming to the InfoPath schema, the X-document name must be identical to the InfoPath Form ID and the X-document

solution version must be equal to the InfoPath Form Template version.

You can improve the efficiency of the UpdateRecords operation by limiting the size of the Forms2RecordDataSet. For example, you can reduce the size of the Forms2RecordDataSet by:

  • Not including file attachment content.

  • Reducing the number of columns included in the Data element for each updated record. If the data in any column is not being updated, you can remove that column from the Forms2RecordDataSet Data element. You can always remove the system field columns whose values are ignored in UpdateRecords, such as _Modified and _ModifiedBy.

See Also

Reference

GrooveForms2.UpdateRecords Operation

Concepts

Accessing Forms Tool Records

Using ADO.NET DataSets to Access Forms2RecordDataSet Data

Updating Unread Marks

Deleting Records