How To convert Kofax Capture Values to KTM
Issue
Why are index values populated before KTM Server not copied into fields in KTM modules?
Solution
Default/pre-populated Kofax Capture values and KIC populated values will not be transferred to KTM. The values, however, are available in the XValues collection and can be easily scripted into the KTM fields. To copy over Capture values at the beginning of KTM Server, call the following sample function from the Project script in Document_BeforeExtract:
Public Sub CaptureFieldsToKTMFields(pXDoc As CscXDocument) If Project.ScriptExecutionMode=CscScriptExecutionMode.CscScriptModeServer And Project.ScriptExecutionInstance = 1 Then Dim lCount As Long For lCount = 0 To pXDoc.Fields.Count - 1 Dim Key As String Key = "AC_FIELD_" & pXDoc.Fields.ItemByIndex(lCount).Name If pXDoc.XValues.ItemExists(Key) Then pXDoc.Fields.ItemByIndex(lCount).Text = pXDoc.XValues.ItemByName(Key).Value End If Next End If End Sub
In order for the code above the work the following must be done:
- In the Batch Class Extended Synchronization Settings, the setting "Populate all index fields for read-only access in script" must be enabled.
- If using the Scan module to assign a Form Type ensure that "Populate default index fields at Scan" is enabled. This setting can be found in the Batch Class Properties | Advanced tab.
- The Form Type must be defined before the document is sent to KTM Server. Documents without form types will not have pre-populated Capture values. If using KIC this should be done by default. However if using Scan this can be done by right click on the document, clicking Create Document, and then selecting the document class with prepopulated values.
The attachment below contains a project saved in KTM 6.2.1.0 that implements the code above. The attachment also contains a batch class synced with the project using Kofax Capture 11.0.0.5:
Level of Complexity
High
Applies to
Product | Version | Build | Environment | Hardware |
---|---|---|---|---|
Kofax Transformation Modules |
6.3 6.4 |
References
Add any references to other internal or external articles