Share via


RecordQuery Complex Type

Applies to: SharePoint Workspace 2010 | Visual Studio 2008

The RecordQuery type specifies the selection conditions for a record query.

Syntax

<RecordQuery>
  <ViewURI />    
  <FormURI />    
  <UnreadRecordsOnly />
  <WhereClause />
  <QueryMetadataOnly />
  <IncludeFileAttachmentContent />
</RecordQuery>

Complex Type Elements

Element

Data type

Description

ViewURI

xs:anyURI

If specified, only records defined in this view will be included in the query. Default value is empty string; in this case records will not be filtered on the basis of being included in a view.

FormURI

xs:anyURI

If specified, only records created using this form will be included in the query. Default value is empty string; in this case records will not be filtered on the basis of the form used to create the record.

UnreadRecordsOnly

xs:boolean

If true, only unread records will be included in the query. If false, both read and unread records will be included in the query. Default value is false.

WhereClause

xs:string

Specifies the condition to use to select records. The format of the WhereClause is described in the Remarks section. Default is an empty string; no condition is applied to filter the records.

QueryMetadataOnly

xs:boolean

If true, the returned Schema element will contain record schemas for all forms that exist in the tool and the returned Data element will be empty. If QueryMetadataOnly is true, the other RecordQuery elements will be ignored. If QueryMetadataOnly is false, all records that match the query will be returned in the Data element and the returned Schema element will contain only the record schemas for the record types of the returned records.

IncludeFileAttachmentContent

xs:boolean

If true, the attachment contents will be included in the record in the FileAttachmentContent element. If false when querying records in Groove Forms Tools, the FileAttachmentContent element will not be provided, but the other FileAttachment elements, such as the FullName and Size, are provided. Default is false.

Remarks

The WhereClause specifies the condition to select records. The syntax of the clause is similar to an SQL where clause. The string consists of a conditional expression or a series of conditional expressions joined by AND and OR logical operators. Parentheses can be used to control the order in which the AND and OR operators are applied. The conditional expression has the format:

field-nameconditional-operatorvalue

The conditional-operator is any of the operators listed in the following table. The value can be a string, rich text, numeric, Boolean or date-time value.

Conditional Operator

Explanation

=

Tests if the value in a field equals the specified value. Valid for all field types.

<>

Tests if the value in a field is not equal to specified value. Valid for all field types

>

Tests if the value in a field is greater than the specified value. Valid for numeric and date fields.

>=

Tests if the value in a field is greater than or equal to the specified value. Valid for numeric and date fields.

<

Tests if the value in a field is less than the specified value. Valid for numeric and date fields.

<=

Tests if the value in a field is less than or equal to the specified value. Valid for numeric and date fields.

LIKE

Tests if the value starts with ('abc%'), ends with ('%abc'), or contains ('%abc%') the specified value. Valid for string and rich text fields.

NOT LIKE

Tests if the value does not start with ('abc%'), does not end with ('%abc'), and does not contain ('%abc%') the specified value. Valid for string and rich text fields.

String and rich-text comparisons are always case-sensitive.

Values must be formatted as follows in a WhereClause:

  • String and rich text: Enclose between single quotation marks. For example, to query all records where the State field is equal to Massachusetts, you would set the where clause as shown in the following C# expression. The single quotes are escaped because they appear within a quoted string.

    query.WhereClause = "State = \'MA\'";

  • Numeric and Boolean values: Optionally enclose between single quotation marks.

  • Date-time values: Format date-time values enclosed in # within single quotes as either with or without fractional seconds as follows:

    '#yyyy-MM-ddThh:mm:ss.sssZ#'

    '#yyyy-MM-ddThh:mm:ssZ#'

    where the T indicates the start of the time portion of the string and the Z indicates the time is UTC. (If the time is in a different time zone, indicate the time zone as + or - hh:mm in place of the Z.)

See Also

Reference

GrooveForms2 Web Service

GrooveForms2.QueryRecords Operation

Forms2RecordDataSet Complex Type

Concepts

Querying Records