Question:
After importing the document from hot-folder, the original document will move to the Processed folder where FlexiCapture will create the sub-folder with batch name according to the imported batch.
How to move the original image out of the batch name and place all imported images in the Processed folder without its batch name folder?
Solution:
In Document Definition, create 4 fields:
ImageSourceImportPathSF, BatchnameSF, ProcesedBatchPath, and ImageFileNameOnly
where:
ImageSourceImportPathSF is the ImageSource from the Data Source tab
BatchNameSF is the batch name from the Data Source tab
Under ProcessedBatchPath, create a Rule script where we are going to retrieve the image file name and the path of the Processed path and put these value in the fields ImageFileNameOnly and ProcessedBatchPath such as:
Then under advance workflow, at any stage after importing the image, you can create a custom workflow script to move the images from the Processed\sub-batch-folder-name to the Processed folder such as:
Give your workflow name such as: Move ProcessedBatchImageScript
and paste this script in the Document processing
string filename = Document.Field("Invoice\\ImageFileNameOnly").Text;
string originalpath = Document.Field("Invoice\\ProcessedBatchPath").Text + "\\" + Document.Field("Invoice\\BatchNameSF").Text + "\\" + filename;
string desiredpath = Document.Field("Invoice\\ProcessedBatchPath").Text + "\\" + filename;
Processing.ReportMessage("originalpath: " + originalpath);
Processing.ReportMessage("desiredpath: " + desiredpath);
System.IO.File.Copy(originalpath, desiredpath, true);
Comments
0 comments
Please sign in to leave a comment.