ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

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

Open gretanorv opened this issue 3 years ago • 4 comments

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

    local procedure DeleteAfterPosting(var PurchHeader: Record "Purchase Header") 
... 
              exit;
 
         with PurchHeader do begin
             IsHandled := false;
>             OnDeleteAfterPostingBeforeDelete(PurchHeader, IsHandled);//New Event
             if not IsHandled then begin
                 if HasLinks then
                     DeleteLinks();
                 Delete(); 
             end;
  
     [IntegrationEvent(false, false)]
     local procedure OnDeleteAfterPostingBeforeDelete(var PurchHeader: Record "Purchase Header"; var IsHandled: Boolean)
     begin
     end; 

gretanorv avatar Apr 05 '23 10:04 gretanorv

Can you provide full code of procedure, if you start with BEGIN, we need to understand where the BRGIN part should END? We cannot process this requests for now.

AlexanderYakunin avatar Apr 25 '23 10:04 AlexanderYakunin

I have updated the request accordingly. END was added after Delete() statement

gretanorv avatar Apr 25 '23 11:04 gretanorv

So you want to skip delete of header but still delete all lines? Did I understand this correctly?

Why do you need this event at all, you already can use this event and replace our code with yours?

    OnBeforeDeleteAfterPosting(PurchHeader, PurchInvHeader, PurchCrMemoHeader, SkipDelete, SuppressCommit, TempPurchLine, TempPurchLineGlobal);
    if SkipDelete then
        exit;

We do not want to add many small events for small pieces of code, this is very tricky to manage.

AlexanderYakunin avatar Apr 25 '23 11:04 AlexanderYakunin

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: 11042.

JesperSchulz avatar Jun 07 '23 08:06 JesperSchulz