Skip to main content

Scripting - Accessing User ID during Batch InteractiveClosing Event

Article # 3035476 - Page views: 201


Is there a method by which we may restrict specific users from closing batches in KTM thin client validation, allowing only for suspension?



In script, it is possible to get the user processing the batch.

1) The logged in user name in Validation is stored in the batch XValue AC_BATCH_USERNAME if User Profiles is activated in Capture. This name can be extracted via script:



These correspond to the Kofax Capture Values, "{Operator Name}", "{User Name}" and "{Operator User ID}".

If using KTM Thin Client Server (TCS), and if User Profiles is not activated, the results are different.

If User Profiles has not been activated in Kofax Capture, the "AC_BATCH_USERNAME" will probably be "NETWORK SERVICE". Or, if accessing the system's "USERNAME", this may result in a domain user name on the machine running TCS.

Note that TCS does not provide all the capabilities of the rich client validation.

2) As you are trying to access this data from a batch level event, "Batch_InteractiveClosing" event, this value can be extracted from the corresponding XRootFolder. For example:


The event provides the following parameters:

Private Sub Batch_InteractiveClosing(ByVal pXRootFolder As CASCADELib.CscXFolder, ByVal CloseMode As CASCADELib.CscBatchCloseMode, ByRef bCancel As Boolean, ByRef sMessage As String)


CloseMode parameter with possible values of "CscBatchCloseSuspend", "CscBatchCloseError", and "CscBatchCloseFinal".

Parameter "bCancel" can be set to true to cancel the closing of the batch.

Finally, the "sMessage" parameter can be configured to contain text that will be shown as user information to explain why the closing of the batch was cancelled.


Level of Complexity 



Applies to  

Product Version Build Environment Hardware
Kofax Transformation Modules All      



Article # 3035476
  • Was this article helpful?