How to deal with duplicate invoices

I need help marking invoices which are a duplicate, It should be marked in M-files if the vendor number & invoice number is the same with another incoming invoice, that it is a duplicate, how do I implement this ? Property Calculator ? And what would that look like ? Thank you.

  • If you want to prevent the saving of such duplicate invoices in the first place, Compliance Kit has a free module called Unique Object Enforcement. It enables you to create validation rules that prevent saving objects if another object already has an identical set of selected property values.

  • But our goal is not to prevent the storage in M-Files, the duplicate should only be recognizable by looking at it means, if there is a duplicate, should the title or the metadata change so that it is visible that it is a duplicate or should a mail be sent to the assigned persons, how is this implemented ?
  • There is no single Property Calculator rule that would do this but you can combine rules to implement similar functionality.

    For example structure below would add list of duplicate items to new object. 


    Condition: Version = 1 makes this calculation to happen only when object is created.

    Calculation itself requires 2 parts:

    1. Search duplicate invoices and save them to multi select lookup property (Duplicate Invoices -property in picture)

    - Objects which vendor number and invoice number are same as created object.

    - You might also want to restrict results to some specific class etc.

    2. Depending on event handler used, search might find also object itself. You probably want to filter it out from list. That can be done for example by comparing internal ID:s of object. There is example configuration in picture.


    This "Duplicate invoices" list can then be used in view conditions, in searches, to trigger email notification, to set separate "Duplicate" boolean property etc.

  • I sometimes configured Unique Object Enforcement to run in a particular workflow state. Duplicate objects will then not be admitted into that state. If objects are unique they will be forwarded automatically and can carry on in the process. Then I set up a different workflow state for duplicate objects and set automatic transition with a time delay of a few hours using a script or perhaps after 1 day, if that is acceptable. This way you can send off the first invoice in one direction and the duplicates in a different direction. It takes a little time for the second part to work though.