SetCustomFieldCriterion method

Sets a custom field criterion for the search.

Syntax


C++
HRESULT SetCustomFieldCriterion(
   BSTR FieldName,
   ERUOperator Operator,
   VARIANT Value1,
   VARIANT Value2)
Scripting languages
object.SetCustomFieldCriterion
   FieldName as String,
   Operator as ERUOperator,
   Value1 as VARIANT,
   Value2 as VARIANT

Parameters


FieldName

Specifies the name of a Custom Field Definition.

Operator

The comparison operator for the search criterion.

For further information, see ERUOperator.

Value1

The first value for the search criterion.

Value2

The second value for the search criterion. This parameter is ignored unless Operator is erOperBetween.

Return value


C++

The return code.

Scripting languages

None.

Remarks


Example:

Criteria.SetCustomFieldCriterion("Priority", erOperEqual, "High", "")

Note:

You may call SetCustomFieldCriteria() only once per custom field.  You must call ClearCustomFieldCriteria() to clear previous criteria before setting new criteria for a custom field.

Note:

Only certain operators are allowed for certain custom fields, as shown in the table below. Also, if the custom field type is plain text, you can specify a boolean expression as the search value, e.g. "NOT(apple or orange)"

Field Type Allowed Operator

Plain Text

erOperEqual

Date

erOperEqual, erOperLess, erOperGreater, erOperBetween

Number

All except erOperBetween

Member

erOperEqual

Yes/No

erOperEqual

List

erOperEqual

 

Home

Applies to

IERUSearchCriteria