ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Request] codeunit 90 "Purch.-Post" - OnBeforePostInvoiceCheckCredit

Open gretanorv opened this issue 3 years ago • 3 comments

Hello, would it be possible to add OnBeforePostInvoiceCheckCredit, event to codeunit 90 "Purch.-Post", like this:

    local procedure PostInvoice(var PurchHeader: Record "Purchase Header") 
... 
              if PurchSetup."Ext. Doc. No. Mandatory" or (GenJnlLineExtDocNo <> '') then
                 CheckExternalDocumentNumber(VendLedgEntry, PurchHeader);
 
             IsHandled := false;
>             OnBeforePostInvoiceCheckCredit(PurchHeader, HideProgressWindow, Window, TotalPurchLine, TotalPurchLineLCY, GenJnlLineDocType, GenJnlLineDocNo, GenJnlLineExtDocNo, SrcCode, IsHandled);//New Event
             if not IsHandled then
                 // Post vendor entries
                 if GuiAllowed and not HideProgressWindow then
                     Window.Update(4, 1); 
  
     [IntegrationEvent(false, false)]
     local procedure OnBeforePostInvoiceCheckCredit(var PurchHeader: Record "Purchase Header"; var HideProgressWindow: Boolean; var Window: Dialog; var TotalPurchLine: Record "Purchase Line"; var TotalPurchLineLCY: Record "Purchase Line"; var GenJnlLineDocType: Enum "Gen. Journal Document Type"; var GenJnlLineDocNo: Code[20]; var GenJnlLineExtDocNo: Code[35]; var SrcCode: Code[10]; var IsHandled: Boolean)
     begin
     end; 

gretanorv avatar Apr 05 '23 10:04 gretanorv

May I ask what is the purpose of this event and why you need this here? We cannot implement handled event here!

AlexanderYakunin avatar Apr 25 '23 10:04 AlexanderYakunin

The purpose is to execute the following code only under certain conditions without modifying HideProgressWindow variable

gretanorv avatar Apr 25 '23 11:04 gretanorv

I don't see how this event can help to solve this task! Can you provide full code of procedure with wanted changes? And explain how this is supposed to work?

AlexanderYakunin avatar Apr 25 '23 11:04 AlexanderYakunin