0

When releasing documents the scan operator should get logged to a file. I know this is a kofax system variable but how do I get it from the ReleaseData object?

Maybe this value is hold by the Values collection? What is the key then? I would try to access it by using

string scanOperator = documentData.Values["?scanOperator?"].Value;

1 Answers1

0

Kofax's weird naming convention strikes again - during setup, said items are referred to as BatchVariableNames. However, during release they are KFX_REL_VARIABLEs (an enum named KfxLinkSourceType).

Here's how you can add all available items during setup:

foreach (var item in setupData.BatchVariableNames)
{
    setupData.Links.Add(item, KfxLinkSourceType.KFX_REL_VARIABLE, item);
}

The following sample iterates over the DocumentData.Values collection, storing each BatchVariable in a Dictionary<string, string> named BatchVariables.

foreach (Value v in DocumentData.Values)
{
    switch (v.SourceType)
    {
        case KfxLinkSourceType.KFX_REL_VARIABLE:
            BatchVariables.Add(v.SourceName, v.Value);
            break;
    }
}

You can then access any of those variables by key - for example Scan Operator's User ID yields the scan user's domain and name.

Wolfgang Radl
  • 2,319
  • 2
  • 17
  • 22
  • thanks. But I have one "problem".Kofax' language is set to german so the source name is german too. Do I really have to take the german key? This key would be `Benutzer-ID der Scan-Bedienungsperson`. So for my if statement I would have to take `if (sourceName == "Scan Operator's User ID" || sourceName == "Benutzer-ID der Scan-Bedienungsperson")` but I think this is really ugly .. –  Feb 11 '19 at 07:59
  • 1
    Create a simple batch or index field, hide it, and set its default value to `{Benutzer-ID der Scan-Bedienungsperson}`. Then, instead of using the Kofax value, just use said field. – Wolfgang Radl Feb 11 '19 at 08:03
  • well, thanks, that's a solution. But I think they should have used english keys only :) –  Feb 11 '19 at 08:07
  • If you think that's bad, wait until you see their database naming conventions. – Wolfgang Radl Feb 11 '19 at 08:30