microsoft / ALAppExtensions

Repository for collaboration on Microsoft AL application add-on and localization extensions for Microsoft Dynamics 365 Business Central.
MIT License
770 stars 610 forks source link

[Event Request] Table 5740 "Transfer Header" - procedure PerformManualRelease #26987

Closed dorinbirsan closed 2 weeks ago

dorinbirsan commented 1 month ago

Describe the request

Describe the request

The current change would benefit the fact that we could handle the code from the procedure PerformManualRelease inside "Transfer Header" table.

Current:

    internal procedure PerformManualRelease()
    begin
        if Rec.Status <> Rec.Status::Released then begin
            CODEUNIT.Run(CODEUNIT::"Release Transfer Document", Rec);
            Commit();
        end;
    end;

Requested:

    ...

    internal procedure PerformManualRelease()
    var
        IsHandled: Boolean;
    begin
        OnBeforePerformManualRelease(Rec, IsHandled);
        if IsHandled then
            exit;

        if Rec.Status <> Rec.Status::Released then begin
            CODEUNIT.Run(CODEUNIT::"Release Transfer Document", Rec);
            Commit();
        end;
    end;

    ...

    [IntegrationEvent(false, false)]
    local procedure OnBeforePerformManualRelease(var TransferHeader: Record "Transfer Header"; var IsHandled: Boolean)
    begin
    end;

    ...

Additional context

Justification: we request the event since in BC22 it was introduced that in the actions Create Warehouse Shipment and Create Warehouse receipt the document is released automatically in case it was open. That conflicts now with existing custom logic, that the warehouse document is created already after the release of a document, leading to the issue that it is now tried two times to create the warehouse document. Internal work item: AB#544590

JesperSchulz commented 2 weeks ago

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