Skip to main content
Kofax

Dynamically populate the suggested values drop down ComboBox for an Index Field using a VB.NET Validation Script

16651

QAID # 16651 Published 

Question / Problem:

From a VB.NET Validation Script, is there a way to dynamically populate the suggested values drop-down ComboBox for an Index Field?

Answer / Solution:

Yes. This is exposed by the SuggestedValues collection of the Index Field, and was introduced in Capture 10.

Private Sub Catalog_Orders_DocumentPreProcessing(sender As Object, e As Kofax.AscentCapture.Scripting.PreDocumentEventArgs)
Handles Me.DocumentPreProcessing
    With Customer_Name.IndexField
        'Clear the suggested values for the field.
        .SuggestedValues.RemoveAll()
        'Set the initial value for the field.
        .Value = "Value 1"
        'Add 5 items to the list
        For iLoop As Integer = 1 To 5
            .SuggestedValues.Add("Value " & iLoop)
        Next
        'Force match, and make the field Case Sensitive.
        .SuggestedValuesForceMatch = True
        .SuggestedValuesForceMatchCaseSensitive = True
    End With
End Sub

Applies to:

Product Version
CAPTURE 10.0
  10.1
  10.2
  11.0