microsoft / ALAppExtensions

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

[Event Request] Codeunit 5760 "Whse.-Post Receipt" - OnAfterRemoveSourceFilterFromWhseRcptLine #26729

Closed tendreffy closed 3 months ago

tendreffy commented 3 months ago

Describe the request

Please add the following publisher into the 5760 "Whse.-Post Receipt" codeunit Code procedure:

    local procedure "Code"()
    var
        WhseManagement: Codeunit "Whse. Management";
        GenJnlPostPreview: Codeunit "Gen. Jnl.-Post Preview";
        ShouldCreatePutAway: Boolean;
        IsHandled: Boolean;
    begin
....
            OnCodeOnAfterWhseRcptHeaderModify(WhseRcptHeader);
            SetCurrentKey("No.", "Source Type", "Source Subtype", "Source No.", "Source Line No.");
            FindSet(true, true);
            repeat
                WhseManagement.SetSourceFilterForWhseRcptLine(WhseRcptLine, "Source Type", "Source Subtype", "Source No.", -1, false);
                GetSourceDocument();
                MakePreliminaryChecks();
                InitSourceDocumentLines(WhseRcptLine);
                InitSourceDocumentHeader();
                if not (SuppressCommit or PreviewMode) then
                    Commit();

                CounterSourceDocTotal := CounterSourceDocTotal + 1;

                IsHandled := false;
                OnBeforePostSourceDocument(
                    WhseRcptLine, PurchHeader, SalesHeader, TransHeader, CounterSourceDocOK, HideValidationDialog, IsHandled);
                if not IsHandled then
                    PostSourceDocument(WhseRcptLine);

                if FindLast() then;
                SetRange("Source Type");
                SetRange("Source Subtype");
                SetRange("Source No.");
                >>> New Event
                OnAfterRemoveSourceFilterFromWhseRcptLine(WhseRcptLine, PurchHeader, SalesHeader, TransHeader);
                <<< New Event
            until Next() = 0;

.....
[IntegrationEvent(false, false)]
    local procedure OnAfterRemoveSourceFilterFromWhseRcptLine(var WhseRcptLine: Record "Warehouse Receipt Line"; PurchaseHeader: Record "Purchase Header"; SalesHeader: Record "Sales Header"; TransferHeader: Record "Transfer Header")
    begin
    end;

Additional context

My customer would like to post Warehouse Receipt if there are more Warehouse Receipt Line for the same Purchase Line, but with different Bin Codes. Internal work item: AB#539222

JesperSchulz commented 3 months 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: 21464.