Changing the document defintion using scripting

  • Last Post 06 February 2018
PhinkTad posted this 22 January 2018


I have an Flexicapture for invoices project with multiple copies of the 'Invoices' document definition slightly modified to be used to capture different types of documents.

I've set up batch types that correspond to each of these document definition and assigned them through different import folders and each batch type has only one document definition in the recognition tab.

The problem I'm facing is that, when a user drops in an image file in the wrong folder, it will get recognized according to the batch type defined for that import folder and in the verification station, when you right-click and select 'Match Document definition', there will be only one document definition available.

I want to be able to assign a document to a different document definition (one that is not available in the current batch type).

I was wondering if this is possible if I can create a stage and the user can send a wrongly-filed document to this stage so that it will get recognized accordingly.


Thank you!

Order By: Standard | Newest | Votes
Vladimir Dimitrijevic posted this 23 January 2018


You can accomplish this by using IMatchingInfo, i.e. to set document definition for that document in BeforeMatching event handler.

I would assign a value to Registration Parameter- value should be the name of Document definition:

Document.Properties.Set("DocumentDefinitionName", "Your Document Definition Name");

and then read the value of this parameter in BeforeMatching event handler, something like:

   string documentDefinition = Document.Properties.Get("DocumentDefinitionName");

   Matching.DefinitionsList = documentDefinition;
   Matching.ForceMatch = true;

After assigning a value to the Registration Parameter, you would need to set Exit Route of that stage to be routed to the Recognition stage afterwards.

Best regards,

  • Liked by
  • PhinkTad
Vladimir Dimitrijevic posted this 06 February 2018


Have this solution solved your problem?

Best regards,