Search code examples
vbscriptfieldcapturekofax

how to use batch field name in Kofax Transformation Script


I have created a batch field in Kofax capture as " Invoice_from _Email"

which i need to call in KTM script to assing its value as true.

how can i call the batch field value in KTM script.?


Solution

  • There are two different options on how to do this.

    Mapping a batch/root folder field: The first would be to map the field. In Project Builder open Project Settings and check "Enable folders" on the General tab. This maps the KC batch to the KTM root folder and does not require you to actually create any additional folders. Then you can create a field, presumably named "Invoice_from_Email",on the root folder which you will be able to map to a KC field in the Synchronization Tool for the batch class.

    Because the field is mapped, you have read/write access.

    To use from script it would be:

    pXRootFolder.Fields.ItemByName("Invoice_from_Email").Text
    

    Read-only access without mapping

    pXRootFolder.XValues.ItemByName("AC_FIELD_" & BatchFieldName)
    

    From the documentation:

    Note If you cannot access the field values via script, then you need to check whether the “Populate all index fields for read-only access in script” option is selected on the Extended Synchronization Settings window of the Kofax Transformation Modules - Synchronization Tool. This option is cleared by default, and available only if Kofax Capture 10.0.2 (service pack 2) or a newer version is installed.

    If you don't see this setting it means you have an version prior to when it was added and you don't have to worry about it.