TDFilter object

Create a filtered list of field objects without SQL.

You get a TDFilter object from the Filter property of any factory object except ReqFactory.

Public methods

This object supports the following methods.

Method Description

Clear

Clears the current filter.

Syntax: Clear()

GetXFilter

Gets the cross filter specified by CrossEntities.

Syntax: GetXFilter(crossEntities, inclusive)

Parameters:

  • crossEntities. Possible values are BUG-REQ, BUG-TEST, BUG-TESTSET, REQ-BUG, REQ-TEST, TEST-BUG, TEST-REQ, TEST-TESTSET, TESTSET-BUG, and TESTSET-TEST.

  • inclusive. Accepts true only, which means the filter specifies the set of objects where the conditions for the first entity and for the second entity are all true.

Return: The text representation of the filter.

IsClear

Checks whether the filter is cleared.

Syntax: IsClear()

NewList

Creates a new list from current filter.

Syntax: NewList()

If you call NewList more than once on the same filter, no actual server request is made. NewList returns cached data.

To retrieve data that may have changed, either dispose of the filter and create a new one, or call Refresh before calling NewList.

Refresh

Reads saved data and refreshes the fetched list according to the current filter, overwriting any changes made to the values in the list in memory.

Syntax: Refresh()

SetXFilter

Sets the filter for second entity, called a cross filter.

Syntax: SetXFilter(crossEntities, inclusive, filterText)

Parameters:

  • crossEntities. Possible values are BUG-REQ, BUG-TEST, BUG-TESTSET, REQ-BUG, REQ-TEST, TEST-BUG, TEST-REQ, TEST-TESTSET, TESTSET-BUG, and TESTSET-TEST.

  • inclusive. Accepts true only, which means the filter specifies the set of objects where the conditions for the first entity and for the second entity are all true.

  • filterText. A TDFilter.Text or a string that represents the text of the filter.

Public properties

This object supports the following properties.

Property R/W Type Description

DataType

R String

The filtered entity type.

Fields

R List

The value of the specified field.

The list depends on the factory from which the TDFilter was created. For example, if the filter is created from a TestFactory object, the field list consists of the names of the test fields

Filter

R/W String

The filter condition for the field specified by the field name.

Syntax: TDFilter.Filter[fieldName]

Parameters:

  • fieldName. A string that represents the name of the field in the project database. Use all upper case.

    Only fields whose FiledProperty.IsCanFilter property is true can be used. See FieldProperty object.

Order

R/W Number

The position of the specified field in the list of the sort fields. (zero-based).

Syntax: TDFilter.Order[fieldName]

Parameters:

  • fieldName. A string that represents the name of the field in the project database. Use all upper case.

When the order of one field is set with this property, no adjustments are made to the positions of other fields. The application is responsible for ensuring that the orders of all the fields are as required, that no two fields occupy the same position, and there are no empty positions.

When two or more fields are assigned the same order, the actual order is undetermined.

OrderDirection

R/W Number

The sort order: TDOLE_ASCENDING or TDOLE_DESCENDING.

Syntax: TDFilter.OrderDirection[fieldName]

Parameters:

  • fieldName. A string that represents the name of the field in the project database. Use all upper case.

Text

R/W String

The full fields filter as text.

In most places where a string-type Filter argument is passed to a method that selects items, for example to create a filtered list, it is this Text property that is passed to the method.

XFilter R/W String The cross filter according to the entity type.

Example

Example: Filter records

Example: Retrieve sorted requirements

Back to top