| Back | Main view | Parent doc
Using and customizing IMiS/ICR client
IMiS ICR verification button is part of IMiS Forms subform. LotusScript code is not hidden so developer can customize it if needed. Lets see the code first and then we will comment it:
Sub Click(Source As Button)
Dim IMiSWorkspace As New NotesUIWorkspace
Dim IMiSSem As Integer
Dim IMiSICRProfDocKey As String
Set IMiSUIDoc = IMiSWorkspace.CurrentDocument
Set IMiSDoc = IMiSUIDoc.Document
IMiSICRHWND = IMiSGetForegroundWindow
Call IMiSSetActiveWindow(IMiSICRHWND)
IMiSSem% = 0
'select KEY for getting profile document with ICR settings
'KEY is usually Notes form name, but it can be changed if needed
IMiSICRProfDocKey = Lcase$(IMiSDoc.Form(0))
'initialize ICR objects and add image to batch
'form image is always first in the IMiS table!
If IMiSICRInitObjects(IMiSDoc, IMiSICRProfDocKey) <> 0 Then Exit Sub
Call IMiSSetActiveWindow(IMiSFRObject.HWND)
Call IMiSSetForegroundWindow(IMiSFRObject.HWND)
'recognize and verify in mode 1 - group and/or field verification
Call IMiSICRVerify1
Call IMiSSetActiveWindow(IMiSICRHWND)
Call IMiSSetForegroundWindow(IMiSICRHWND)
'starting loop sequence
IMiSVerifierLoop:
If IMiSSem% <> 0 Then
'verify in mode 2 - document verification
Call IMiSSetActiveWindow(IMiSFRObject.HWND)
Call IMiSSetForegroundWindow(IMiSFRObject.HWND)
Call IMiSICRVerify2
IMiSSem% = 0
End If
'write results to Notes document
Call IMiSICRWriteToNotesDoc(IMiSDoc)
'RESULTS VALIDATION - it is up to Notes developer. Recognized data is in Notes fields. The only important thing that in case of failed
'validation go back to IMiSVerifierLoop for second phase of verification and set IMiSSem variable to <> 0.
'enter your validation code here...
'end validation code
'clearing objects
Call IMiSICRClearObjects
End Sub
- IMiSSem is integer variable that holds information about validation status. It is used by developer to set result of customized validation algorithm.
- IMiSICRProfDocKey is string variable that selects key for profile document. It is usually Notes form name, but it can be changed by developer
- IMiSICRInitObjects initializes objects and parameters for ICR verification (i.e. profile document with settings, batch definition file is loaded,...)
- IMiSICRVerify1 executes FIRST (FIELD/GROUP)verification phase. See verification description for more details.
- IMiSICRVerify2 executes SECOND (DOCUMENT) verification phase. It is executed only if data after first verification phase is not validated successfully. See verification description for more details.
- IMiSICRWriteToNotesDoc writes recognized data back to Notes document. It uses field pairs that are set in settings profile document.
- VALIDATION: Validation algorithm must be developed by customer. Recognized and verified data is written back to Notes document without any validation, because logical data relations are known only to customer. So validation code should be inserted between enter your validation code here... end validation codelines. The only important thing is that in case of unsuccessful validation you should set IMiSSemvariable to <> 0 and to use Goto IMiSVerifierLoop if another iteration of DOCUMENT verification is needed.
- IMiSICRClearObjects terminates objects and frees memory.
| Back | Main view | Parent doc