Skip to main content

Is it possible to reject a Document in KTM and/or add a Rejection Note?

Article # 304870 - Page views: 350


QAID # 19077 Published

Question / Problem:

Is it possible to reject a Document in KTM and/or add a Rejection Note?

Answer / Solution:

Yes. (Paraphrased) Script Help excerpt:

If a Document or one of its Pages is rejected in Kofax Capture, it is reflected in the XValues of the Document.

The following XValue keys are reflecting the rejection state of Documents and Pages:


By using the following key you get the XValue that contains the Rejection Note for a rejected Document:


If a Document has one or more rejected Pages, you find an XValue per rejected Page in the Document with the following key:


Where <n> is the one-based page number of the Page you are interested in.

To get the Rejection Note of a Page, obtain the value of the XValue by the following key:


Also setting the rejection state of a Document or Page and modifying its Rejection Note is supported. All modifications are updated on the Kofax Capture side when the Batch is closed.

See Examples below:

Example — Accessing the Table Field Rows of a Kofax Capture Table Field in the XValues of an XDocInfo object:

     Private Sub Document_BeforeExtract(pXDoc As CASCADELib.CscXDocument)
        Dim sRow As String

   Dim n As Long
   Dim sCols() As String

' first row index is zero n= 0

   While pXDoc.XValues.ItemExists("AC_TABLE_MyTableName_Row_" & n) = True

      sRow = pXDoc.XValues.ItemByName("AC_TABLE_MyTableName_Row_" & n).Value
      sCols = Split(sRow, vbTab)

      ' ...
      ' use the column results for your needs
      ' ...

      n = n+ 1
End Sub

Example — Checking if a Document or one of its Pages is rejected in Kofax Capture:

Private Function IsDocumentRejected(oXDocInfo As CASCADELib.CscXDocInfo) As Boolean
   IsDocumentRejected = False
   If oXDocInfo.XValues.ItemExists("AC_REJECTED_DOCUMENT") Then

IsDocumentRejected = True

      Dim nPageIndex As Long
      For nPageIndex = 0 To oXDocInfo.PageCount - 1

         If oXDocInfo.XValues.ItemExists("AC_REJECTED_PAGE" & CStr(nPageIndex + 1)) Then
            IsDocumentRejected = True
         End If
   End If
End Function

Example — Getting the Rejection Note in Kofax Capture of a Document or one of its Pages:

Private Function GetRejectionNote(oXDocInfo As CASCADELib.CscXDocInfo, _
                                  Optional nPageIndex = 0 As Long) As String

   GetRejectionNote = ""

   If nPageIndex = 0 Then
      ' get the rejection note of the document
      If oXDocInfo.XValues.ItemExists("AC_REJECTED_DOCUMENT_NOTE") Then

         GetRejectionNote = oXDocInfo.XValues.ItemByName("AC_REJECTED_DOCUMENT_NOTE")
      End If

      ' get the rejection note of the page, nPageIndex is one-based
      If oXDocInfo.XValues.ItemExists("AC_REJECTED_PAGE_NOTE" & CStr(nPageIndex)) Then

GetRejectionNote = _
           oXDocInfo.XValues.ItemByName("AC_REJECTED_PAGE_NOTE" & _

      End If
   End If
End Function

Applies To: 

Product Version Category
AXPRO 5.0 Script
AXPRO 5.5 Script
AXPRO 6.0 Script
  • Was this article helpful?