How to rename Batches and Documents in scanning station

Question

How to rename Batches and Documents in the scanning station after sending them to the FlexiCapture?

Resolution

  1. Create a new batch type.
  2. Add a script with the On batch sent event:
    mceclip0.png
  3. Add this script and with the needed names of batch or documents:
    using System;

    string batchName = "";
    int documentPosition = 0;

    for (int i = 0; i < Workspace.ScriptItems.Count; i++)
    {
    var batch = Workspace.ScriptItems[i];

    //If the item we have is not actually a batch, then break current iteration and loop again
    if (!batch.IsBatch)
    continue;

    documentPosition = 0;

    //Rename the batch
    batch.Name = "Custom Batch Name";

    //Iterate through the documents
    foreach (IWorkspaceItem document in batch.Children)
    {
    //If the item we have is not actually a document, then break current iteration and loop again
    if (!document.IsDocument)
    continue;

    //Incrememt document counter
    documentPosition = documentPosition + 1;

    //Rename document
    document.Name = batchName + "_" + documentPosition.ToString() + "Cutom Name of Document";
    }
    }

Was this article helpful?

1 out of 2 found this helpful

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.

Recently viewed