QAID # 16966 Published
Question / Problem:
Is there a way that a Batch Field can be validated?
Answer / Solution:
Yes. There are a couple of methods that can be used.
If validation must be performed at Batch-creation time, a Custom Panel must be implemented to check the Batch Field value and prevent the creation of the Batch until the Field criteria is met.
Probably a better method is to implement a VB.NET Validation script. First, a Document Index Field would have its default value set to the Batch Field to be changed. In the Validation script, the PostFieldEvent of the Field linked to the Batch Field checks the value and changes the Batch Field value if required.
Private Sub Name0_FieldPostProcessing(sender As Object, e As Kofax.AscentCapture.Scripting.PostFieldEventArgs) Handles Name0.FieldPostProcessing If Name0.IndexField.Value <> "ABCDE" Then Throw New ValidationErrorException("Incorrect Value") Else Name0.IndexField.Batch.BatchFields("TestField").Value = Name0.IndexField.Value End If End Sub