How to determine the Field with the corresponding error: "The document has hidden fields, some of which have warnings"

Question

How to determine the Field with the corresponding error: "The document has hidden fields, some of which have warnings" in the document definition.

Answer

Add the following code to the Project Properties > Event Handler > After document state changed if default batch type is used or Batch Type Properties > Event Handler > After document state changed if some custom batch type is used:

string sErrors = "";
foreach (IRuleError ruleError in Document.RuleErrors)
{
foreach (IField f in ruleError.GetFields())
sErrors += f.FullName.ToString() + " ";
sErrors += " : " + ruleError.Message;
FCTools.ShowMessage(sErrors);
sErrors = "";
}

After that:

  1. In the Project Setup Station, create a batch of the required batch type.
  2. Load a document there and recognize it.
  3. Expand the recognition task log.
  4. There will be messages listing all errors and warnings for all fields (including hidden ones):
    mceclip0.png

 

 

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.