ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Request] OCR Service Mgt - OnAfterCorrectOCRFileNodes

Open alinat2022 opened this issue 2 years ago • 8 comments

Describe the request

Hello.

We want to use the "OCR Data Correction" page to send to the OCR software new values of the fields filled in on this page, by using the "Send OCR Feedback" action. Currently, there is no event we could use in order to send also the values of our custom fields that we have added on the "OCR Data Correction" page.

Therefore, please create an event in procedure CorrectOCRFile from codeunit 1294 "OCR Service Mgt." and also remove the Scope = OnPrem from this procedure.

 // [Scope('OnPrem')] // <<Remove Scope = OnPrem>>
   procedure CorrectOCRFile(IncomingDocument: Record "Incoming Document"; var TempBlob: Codeunit "Temp Blob")
   var
       OCRFileXMLRootNode: DotNet XmlNode;
       OutStream: OutStream;
   begin
       ValidateUpdatedOCRFields(IncomingDocument);

       GetOriginalOCRXMLRootNode(IncomingDocument, OCRFileXMLRootNode);

       CorrectOCRFileNode(OCRFileXMLRootNode, IncomingDocument, IncomingDocument.FieldNo("Vendor Name"));
       CorrectOCRFileNode(OCRFileXMLRootNode, IncomingDocument, IncomingDocument.FieldNo("Vendor Invoice No."));
       CorrectOCRFileNode(OCRFileXMLRootNode, IncomingDocument, IncomingDocument.FieldNo("Order No."));
       CorrectOCRFileNode(OCRFileXMLRootNode, IncomingDocument, IncomingDocument.FieldNo("Document Date"));
       CorrectOCRFileNode(OCRFileXMLRootNode, IncomingDocument, IncomingDocument.FieldNo("Due Date"));
       CorrectOCRFileNode(OCRFileXMLRootNode, IncomingDocument, IncomingDocument.FieldNo("Amount Excl. VAT"));
       CorrectOCRFileNode(OCRFileXMLRootNode, IncomingDocument, IncomingDocument.FieldNo("Amount Incl. VAT"));
       CorrectOCRFileNode(OCRFileXMLRootNode, IncomingDocument, IncomingDocument.FieldNo("VAT Amount"));
       CorrectOCRFileNode(OCRFileXMLRootNode, IncomingDocument, IncomingDocument.FieldNo("Currency Code"));
       CorrectOCRFileNode(OCRFileXMLRootNode, IncomingDocument, IncomingDocument.FieldNo("Vendor VAT Registration No."));
       CorrectOCRFileNode(OCRFileXMLRootNode, IncomingDocument, IncomingDocument.FieldNo("Vendor IBAN"));
       CorrectOCRFileNode(OCRFileXMLRootNode, IncomingDocument, IncomingDocument.FieldNo("Vendor Bank Branch No."));
       CorrectOCRFileNode(OCRFileXMLRootNode, IncomingDocument, IncomingDocument.FieldNo("Vendor Bank Account No."));
       CorrectOCRFileNode(OCRFileXMLRootNode, IncomingDocument, IncomingDocument.FieldNo("Vendor Phone No."));
       OnAfterCorrectOCRFileNodes(OCRFileXMLRootNode, IncomingDocument,FieldNo); // <<New Event>>
       Clear(TempBlob);
       TempBlob.CreateOutStream(OutStream);
       OCRFileXMLRootNode.OwnerDocument.Save(OutStream);
   end;
   
   // <<New Event
   [IntegrationEvent(false, false)]
   local procedure OnAfterCorrectOCRFileNodes(var OCRFileXMLRootNode: DotNet XmlNode; var IncomingDocument: Record "Incoming Document"; FieldNo: Integer)
   begin
   end;
   // >>New Event

Additional context

We want to use the "OCR Data Correction" page to send to the OCR software new values of the fields filled in on this page, by using the "Send OCR Feedback" action. Currently, there is no event we could use in order to send also the values of our custom fields that we have added on the "OCR Data Correction" page.

Thank you. Internal work item: AB#555038

alinat2022 avatar Oct 16 '24 08:10 alinat2022

Hello, @Jose-agg . I also added something extra: to remove the Scope = OnPrem from the procedure. Can you please add this to your internal work item? Thank you in advance.

alinat2022 avatar Oct 16 '24 13:10 alinat2022

Availability update: We will publish a fix for this issue in the next update for release 25.

Build ID to track: 29352.

JesperSchulz avatar Jan 27 '25 09:01 JesperSchulz

Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.

Build ID: 29248.

JesperSchulz avatar Jan 27 '25 09:01 JesperSchulz

Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.

Build ID: 29248.

JesperSchulz avatar Jan 27 '25 09:01 JesperSchulz

Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.

Build ID: 29248.

JesperSchulz avatar Jan 28 '25 10:01 JesperSchulz

Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.

Build ID: 29248.

JesperSchulz avatar Jan 28 '25 10:01 JesperSchulz

Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.

Build ID: 29248.

JesperSchulz avatar Jan 28 '25 10:01 JesperSchulz

Availability update: We will publish a fix for this issue in the next update for release 25.

Build ID to track: 29352.

JesperSchulz avatar Jan 28 '25 10:01 JesperSchulz