Skip to content

[EVENT REQUEST] Table 5876 "Phys. Invt. Order Line" in procedure TestQtyRecorded() #29405

@KaMu0608

Description

@KaMu0608

Why do you need this change?

Hi,
we have informational bin codes in the phys. Inventory recording which have no inventory. Therefore we have bin codes in the table "Phys. Invt. Record Line" but not in the table "Phys. Invt. Order Line". We have to prevent the testfield on Bin Code

Describe the request

We need an additional event in the table 5876 "Phys. Invt. Order Line" in the procedure TestQtyRecorded() to prevent the testfield on Bin Code.

    procedure TestQtyRecorded()
    var
        PhysInvtRecordLine: Record "Phys. Invt. Record Line";
        "Sum": Decimal;
        IsHandled: Boolean; //new
    begin
        Sum := 0;

        PhysInvtRecordLine.Reset();
        PhysInvtRecordLine.SetCurrentKey("Order No.", "Order Line No.");
        PhysInvtRecordLine.SetRange("Order No.", "Document No.");
        PhysInvtRecordLine.SetRange("Order Line No.", "Line No.");
        OnTestQtyRecordedOnAfterPhysInvtRecordLineSetFilters(Rec, PhysInvtRecordLine);
        if PhysInvtRecordLine.Find('-') then
            repeat
                PhysInvtRecordLine.TestField("Item No.", "Item No.");
                PhysInvtRecordLine.TestField("Variant Code", "Variant Code");
                PhysInvtRecordLine.TestField("Location Code", "Location Code");
                IsHandled := false;
                OnTestQtyRecordedOnBeforeTestFieldBinCode(Rec, PhysInvtRecordLine, IsHandled); //here new Event
                if not IsHandled then
                    PhysInvtRecordLine.TestField("Bin Code", "Bin Code");
                if "Use Item Tracking" then
                    if (PhysInvtRecordLine."Quantity (Base)" <> 0) and (not PhysInvtRecordLine.TrackingExists()) then
                        Error(
                            MustSpecifyTrackingErr, PhysInvtRecordLine."Recording No.",
                            StrSubstNo(IndenitiedValuesMsg, "Item No.", "Variant Code", "Location Code", "Bin Code"));
                Sum := Sum + PhysInvtRecordLine."Quantity (Base)";
            until PhysInvtRecordLine.Next() = 0;

        if "Qty. Recorded (Base)" <> Sum then
            Error(
                DifferentSumErr,
                StrSubstNo(IndenitiedValuesMsg, "Item No.", "Variant Code", "Location Code", "Bin Code"));
    end;

    [IntegrationEvent(false, false)]
    local procedure OnTestQtyRecordedOnBeforeTestFieldBinCode(var PhysInvtOrderLine: Record "Phys. Invt. Order Line"; var PhysInvtRecordLine: Record "Phys. Invt. Record Line"; var IsHandled: Boolean)
    begin
    end;

Internal work item: AB#612792

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