Kofax DOKuStar Validation User Manual
Page 68

DOKuStar Validation Programming Manual
Page
• 64
The alternative is to create a new cursor and add filters, which may be the predefined two filters or newly created
ones, as in the second example:
Option Explicit
Private Sub Application_OnProjectLoaded(ByVal App As Application)
Dim crs As Cursor
Dim fieldFilter As FieldStateFilter
Dim docFilter As DocumentTypeFilter
Dim docType As DocumentType
'* add a new cursor and activate it
Set crs = App.Project.DataSet.Controller.Cursors.Add("dataset::DefaultCursor", "MyCursor")
App.Project.DataSet.Controller.Cursor = crs
Set fieldFilter = crs.Filters.Add("dataset::FieldStateFilter", "ErrorAndReject")
Set docFilter = crs.Filters.Add("dataset::DocumentTypeFilter", "InvoiceAndOrder")
'* get the fieldState Filter
fieldFilter.Reset '* set all states to FALSE
docFilter.Reset '* set all Doc.Types to FALSE
fieldFilter.State(StateReject) = True '* set StateReject to TRUE
fieldFilter.State(StateError) = True '* set StateError to TRUE
'* get the "Invoice" doc.type object
Set docType = App.Project.DataSet.Schema.DocumentTypes("Order")
docFilter.Type(docType) = True
End Sub
Here, a new cursor object with name
MyCursor
(the
className
is always
dataset::DefaultCursor
) is
created, and activated afterwards by being assigned to the controller’s
Cursor
property. We then create two new
filters, one for each existing type
dataset::FieldStateFilter
and
dataset::DocumentTypeFilter
. The rest
of the code is the same as in the first example.
The
Cursor
object has got properties
Documents
and
Fields
. These return the list of documents/fields with
respect to the currently selected filters.
Properties and methods of the
Cursors
object (excerpt):
Property/Method
Returns
Description
Add
Cursor
Adds a new cursor to the list. The newly created cursor is returned.
Parameters:
ClassName As String
: Always
dataset::DefaultCursor
Name As String
At
Cursor
Returns the cursor from the list at the given index position or with the
specified name.
Parameter:
Index As Long or Name As String
Name is the name under which the cursor was added to the list; the
standard cursor is named
default
In addition, all the methods defined for collections are available.