Skip to main content

Dynamically Change Database Locator Exclusion Database


Question / Problem: 

Dynamically Change Database Locator Exclusion Database

Answer / Solution: 

A Database Locator includes an "OwnRecords" database which is used to exclude certain results. This can be used to suppress your own address from the Database Locator. A BPO which is processing documents for various customers requires a different database per customer. The following code changes the OwnRecordsDatabase in a Database Locator dynamically:

Private Sub SL_ExclusionDatabase_LocateAlternatives(ByVal pXDoc As CASCADELib.CscXDocument, _
                                                    ByVal pLocator As CASCADELib.CscXDocField)

   'Add reference to "Kofax Cascade Database Locator 4.0"=CscDBloc2.dll if not yet existing!
   Dim dblocatormethod As CscDBLocLib.CscDatabaseLocator
   Set dblocatormethod = _
   dblocatormethod.OwnRecordsDBName = getBatchField("Customer", pXDoc)
End Sub

Where Get Batch Field Value gets the customer name from a Kofax Capture Batch Field.

NOTE: This code needs to be in a Script Locator that runs before the Database locator. Also the scripting reference "Kofax Cascade Dtabase Locator 4.0" needs to be added in order to run the code.


Applies to:  

Product Version Category
KTM 6.3 Scripting
KTM 6.2 Scripting


  • Was this article helpful?