Fieldclass events – Kofax DOKuStar Validation User Manual

Page 39

Advertising
background image

DOKuStar Validation for Ascent Capture

Page

35

FieldClass Events

There are the same events for

FieldClass

objects as for

FieldType

objects, see there for a description of the

events. The only additional event for the

FieldClass

object is a

OnFieldClassDeleted

event, which is not

used in the Ascent Capture version of DOKuStar Validation.

You will use

FieldClass

events when you want to handle all fields of a certain

FieldClass

(= Ascent Capture

FieldType

) alike. For example, if you have several date fields, you might define them in the Ascent Capture

Administration module in a way that they all belong to the same Ascent Capture

FieldType

MyDateType

. You

will then define a

FieldClass

in the script accordingly and use its

OnFieldChanging

event to do checks:

Dim WithEvents myDateType As FieldClass

Private Sub Application_OnProjectLoaded(ByVal App As Application)
Set myDateType = App.Project.DataSet.Schema.FieldClasses("MyDateType")
End Sub

Private Function myDateType_OnFieldChanging(ByVal Field As Field, ByVal SubField As Field, ByVal
VerifyEventArgs As VerifyEventArgs) As Boolean
myDateType_OnFieldChanging = True
If DateCheck(Field.Value) = False Then
MsgBox "Date is invalid"
myDateType_OnFieldChanging = False
End If
End Function

Private Function DateCheck(strDate As String) As Boolean
' Do Date Checking, return True or False
End Function

Advertising