Share via


Querying Records

When you call the QueryRecords operation, you can specify that the records returned should be restricted by any number of the following constraints:

  • Records that belong to a specific view.

  • Records that were created with a specific form.

  • Records that are unread.

  • Records that meet the search criteria specified in the WhereClause.

If you do not specify any of these constraints, then the QueryRecords operation returns all the records in the Forms tool that you have permission to read. If there are records in the tool that you do not have permission to read, they will not be returned by the QueryRecords operation even if they otherwise meet the query constraints.

You can specify whether the contents of attachment fields are included with the IncludeFileAttachments parameter. If the IncludeFileAttachments parameter is false, then the descriptive elements of attachment fields — such as the attachment name and size — are included, but the contents of the attachment are excluded.

You can improve the efficiency of the QueryRecords operation by:

  • Reducing the number of records returned — it is more efficient to have several QueryRecords operations that return a limited set of records than to read all the records with a single operation. You can use the WhereClause and other parameters to select the records you need rather than reading all the records and then only using a subset of them.

  • Reducing the number of file attachments read — reading file attachments requires significant resources. You can reduce the number of file attachments read by specifying a false value for the IncludeFileAttachmentContent parameter. Then call ReadRecords with a limited set of records whose file attachment contents you need.

If the QueryMetadataOnly parameter is true, then no records are returned and the returned Schema element contains the record schemas for all forms in the tool.

In This Section

Example Code: Querying Records with a Where Clause

See Also

Reference

GrooveForms2.QueryRecords Operation

Concepts

Accessing Forms Tool Records
Using ADO.NET DataSets to Access Forms2RecordDataSet Data
Accessing the Forms2RecordDataSet Data Using XMLDocument
Reading Records Specified by URI