Owner's manual
DOKuStar Validation for Ascent Capture Page • 51
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
Set crs = App.Project.DataSet.Controller.Cursors.Add("dataset::DefaultCursor", "MyCursor")
' Add a new cursor
App.Project.DataSet.Controller.Cursor = crs ' Activate it
Set fieldFilter = crs.Filters.Add("dataset::FieldStateFilter", "ErrorAndReject") ' Add a
fieldState Filter
Set docFilter = crs.Filters.Add("dataset::DocumentTypeFilter", "InvoiceAndOrder") '
get the Documenttype Filter
fieldFilter.Reset ' sets all states to FALSE
fieldFilter.State(StateReject) = True ' set StateReject to TRUE
fieldFilter.State(StateError) = True ' set StateError to TRUE
docFilter.Reset ' sets all Doc. Types to FALSE
Set docType = App.Project.DataSet.Schema.DocumentTypes("Invoice") ' get the "Invoice"
doc.type object
docFilter.Type(docType) = True ' set it to true
Set docType = App.Project.DataSet.Schema.DocumentTypes("Order") ' get the "Order" doc.type
object
docFilter.Type(docType) = True ' set it to 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.
Properties and methods of the
Cursor object (excerpt):