BuildUniqueKeyField

Description

Builds and returns a unique key display field. Adds a display column to the query that contains the ID of stateful records and a concatenation of the unique key fields of stateless records. A unique key is the same value as the display name for a record.

Adds the unique key as a display field in the query's search results. The display column is added to the list so its number, or column value (for GetColumnValue), is one higher than the last column added to the list (or 1 if it is the first column).

The IsShown property (of the returned QueryFieldDef object) must be set to True for the field to be added to the display list. If the value for the IsShown property is set to False, the unique key is not added to the query result set as a column.

Note: The method adds the DBID field to the query and marks that field to be converted into the unique key for the record when the query is run. The QueryFieldDef returned from the BuildUniqueKeyField method appears as if only the DBID field is selected, but the ResultSet produced by executing the query returns the record's display name as the column value. For stateless records, the display name is formed by joining each unique key field with a separating space.

Syntax

VBScript


querydef.BuildUniqueKeyField 

Perl


$querydef->BuildUniqueKeyField(); 
Identifier
Description
querydef
A QueryDef object.
Return value
Returns a QueryFieldDef object for the unique key query field.