TsgcAIDocumentExtractor › Properties › RaiseOnInvalid

RaiseOnInvalid Property

Raises EsgcAIDocumentExtractor when the data still does not validate after the retries.

Syntax

property RaiseOnInvalid: Boolean read FRaiseOnInvalid write FRaiseOnInvalid default True;

Default Value

True

Remarks

When True, an extraction whose data still does not validate after ValidationRetries raises EsgcAIDocumentExtractor with the validation errors in the message. When False the method returns the data as it came, LastResult.Valid is False and LastResult.ValidationErrors lists the problems, so the document can be sent to a manual review.

Example

oExtractor.RaiseOnInvalid := False;
vJSON := oExtractor.ExtractFile('invoice.pdf');
if not oExtractor.LastResult.Valid then
  Memo1.Lines.AddStrings(oExtractor.LastResult.ValidationErrors);

Back to Properties