M-Files API 23.11.13135.0
AddView Method
VaultViewOperations Object : AddView Method
The view object to add.
Description
Adds a new view. Returns the added view.
Syntax
Visual Basic
Public Function AddView( _
   ByVal View As View _
) As View
Parameters
View
The view object to add.
Example
' 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
oExpression.SetStatusValueExpression(MFilesAPI.MFStatusType.MFStatusTypeDeleted)
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

VaultViewOperations Object  | VaultViewOperations Members