Skip to content

[Event Request] Codeunit 80 "Sales-Post" procedure "CheckItemTrackingQuantity" #29828

@Mariangela-DeMaio-EOS

Description

@Mariangela-DeMaio-EOS

Why do you need this change?

Hi,
i ask to add the "SalesHeader" record to the existing event "OnBeforeCheckItemTrackingQuantity" in the procedure "CheckItemTrackingQuantity" in the codeunit 80 "Sales-Post".
I need the "SalesHeader" record to control the "Ship" and "Invoice" fields in our custom.

`

              local procedure CheckItemTrackingQuantity(var SalesLine: Record "Sales Line"; var SalesHeader: Record "Sales Header")
var
    TrackingSpecification: Record "Tracking Specification";
    IsHandled: Boolean;
begin
    IsHandled := false;
    OnBeforeCheckItemTrackingQuantity(SalesLine, IsHandled);   <----------- Add SalesHeader
    if IsHandled then
        exit;
    SyncSurPlusItemTracking(SalesHeader, SalesLine);
    case SalesHeader."Document Type" of
        SalesHeader."Document Type"::Order, SalesHeader."Document Type"::Invoice:
            TrackingSpecification.CheckItemTrackingQuantity(DATABASE::"Sales Line", SalesLine."Document Type".AsInteger(), SalesLine."Document No.", SalesLine."Line No.", SalesLine."Qty. to Ship (Base)", SalesLine."Qty. to Invoice (Base)", SalesHeader.Ship, SalesHeader.Invoice);
        SalesHeader."Document Type"::"Credit Memo", SalesHeader."Document Type"::"Return Order":
            TrackingSpecification.CheckItemTrackingQuantity(DATABASE::"Sales Line", SalesLine."Document Type".AsInteger(), SalesLine."Document No.", SalesLine."Line No.", SalesLine."Return Qty. to Receive (Base)", SalesLine."Qty. to Invoice (Base)", SalesHeader.Receive, SalesHeader.Invoice);
        else
            OnCheckItemTrackingQuantityOnDocumentTypeCaseElse(SalesHeader, SalesLine);
    end;
end;

`

Describe the request

Add the "SalesHeader" record to the existing event "OnBeforeCheckItemTrackingQuantity" in the codeunit 80 "Sales-Post".

`

       [IntegrationEvent(false, false)]
local procedure OnBeforeCheckItemTrackingQuantity(SalesLine: Record "Sales Line"; var IsHandled: Boolean; SalesHeader: Record "Sales Header")
begin
end;

`
Internal work item: AB#625399

Metadata

Metadata

Assignees

No one assigned

    Labels

    SCMGitHub request for SCM areaevent-requestRequest for adding an eventships-in-future-updateFix ships in a future update

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions