How to resolve the issue with Duplicates in PO


When using the PO matching feature the issue with duplicated entries appears as on the screenshot below:



Since Purchase Order is a Repeating Group, FlexiCapture always tries to extract all possible values in the document. If you want to keep only the first value, you can just remove all unnecessary group instances. This could be done via a custom Event Handler or Script Stage.


The following script will remove all instances except the first one:

if (Document.HasField("Invoice Layout\\PurchaseOrder"))
            while (Document.Field("Invoice Layout\\PurchaseOrder").Items.Count>1)
                int itemsCount = Document.Field("Invoice Layout\\PurchaseOrder").Items.Count;
                Document.Field("Invoice Layout\\PurchaseOrder").Items.Delete(itemsCount-1);

Add the script to the Event Handler of the batch type settings or Project settings:

  1. In Project Setup Station open menu Project 
  2. Choose one of the following options:
    • Batch Type, select the batch type, and click Edit > Event handlers > After document state changed > Edit Script.
    • Project > Project Properties > Event Handlers > After document state changed > Edit Script.


Note: The provided script is only for demonstration purposes and must be modified in accordance with the desired workflow. 

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request



Please sign in to leave a comment.