Question
How to rename Batches and Documents in the scanning station after sending them to the FlexiCapture?
Resolution
- Create a new batch type.
- Add a script with the On batch sent event:
- 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";
}
}
Comments
0 comments
Please sign in to leave a comment.