M-Files API 22.6.11519.0
SearchCondition Object
The SearchCondition class is used for accessing and setting a single search condition.
Public Methods
Creates a copy of the object.
Sets the search condition.
Public Properties
The operator of the search condition.
The left side of the search condition.
The right side of the search condition.

A search condition consists of three parts. The left side of the search condition determines which piece of the document's metadata the search condition concerns. The middle part of the search condition is the type of the condition (e.g., "equal" or "not equal"). The right side of the search condition is the desired value of the expression. 

The Expression object encapsulates the data required for the expression, including the left operand and possible options for the expression. A TypedValue object is used to define the value (i.e., an operand for the expression). The condition operator is set with the ConditionType member.



 Setting search conditions and expressions in M-Files Desktop.

' Construct view object.
Dim oView As New MFilesAPI.View
oView.Common = True
oView.Name = "Test View"
oView.ViewType = MFilesAPI.MFViewType.MFViewTypeNormal

' Create search conditions for the view: object status is not deleted
Dim oExpression As New MFilesAPI.Expression
Dim oTypedValue As New MFilesAPI.TypedValue
oTypedValue.SetValue(MFilesAPI.MFDataType.MFDatatypeBoolean, False)
Dim oDeleted As New MFilesAPI.SearchCondition
oDeleted.ConditionType = MFilesAPI.MFConditionType.MFConditionTypeEqual
oDeleted.Set(expression, MFilesAPI.MFConditionType.MFConditionTypeEqual, oTypedValue)
oView.SearchConditions.Add(-1, oDeleted)

' Add the view to client.
oView = oVault.ViewOperations.AddView(oView)
See Also

SearchCondition Members  | Expression Object  | TypedValue Object