Skip to content

[W1][Codeunit][1032][Job Planning Line-Reserve] - TransferJobPlanningLineToItemJournalLineReservationEntry #29862

@Duizy1971

Description

@Duizy1971

Why do you need this change?

I have requested similar issues based on the equivalent sales/purchase/transfer/service reserve codeunits in previous years.
We need to be able to transfer specific item tracking lines (T337 Reservation Entry) to the item journal line during the picking and shipping with our own warehouse module. The request is made in the same way it was implemented in codeunit 99000834 "Purch. Line-Reserve". I have no idea if you want to implement it differently without the use of the IsHandled pattern.

Describe the request

Old code:
procedure TransferJobLineToItemJnlLine(var JobPlanningLine: Record "Job Planning Line"; var NewItemJournalLine: Record "Item Journal Line"; TransferQty: Decimal): Decimal
...
TransferQty :=
CreateReservEntry.TransferReservEntry(Database::"Item Journal Line",
NewItemJournalLine."Entry Type".AsInteger(), NewItemJournalLine."Journal Template Name", NewItemJournalLine."Journal Batch Name", 0,
NewItemJournalLine."Line No.", NewItemJournalLine."Qty. per Unit of Measure", OldReservationEntry, TransferQty);
...
end;

New code:
procedure TransferJobLineToItemJnlLine(var JobPlanningLine: Record "Job Planning Line"; var NewItemJournalLine: Record "Item Journal Line"; TransferQty: Decimal): Decimal
...
TransferJobPlanningLineToItemJournalLineReservationEntry(JobPlanningLine, NewItemJournalLine, OldReservationEntry, TransferQty);
...
end;

local procedure TransferJobPlanningLineToItemJournalLineReservationEntry(var JobPlanningLine: Record "Job Planning Line"; var ItemJournalLine: Record "Item Journal Line"; var OldReservationEntry: Record "Reservation Entry"; var TransferQty: Decimal);
var
    IsHandled: Boolean;
begin
    IsHandled := false;
    OnBeforeTransferJobPlanningLineToItemJournalLineReservationEntry(JobPlanningLine, ItemJournalLine, OldReservationEntry, TransferQty, IsHandled);
    if IsHandled then
        exit;

    TransferQty :=
        CreateReservEntry.TransferReservEntry(
            Database::"Item Journal Line",
            ItemJournalLine."Entry Type".AsInteger(), ItemJournalLine."Journal Template Name",
            ItemJournalLine."Journal Batch Name", 0, ItemJournalLine."Line No.",
            ItemJournalLine."Qty. per Unit of Measure", OldReservationEntry, TransferQty);
end;

[IntegrationEvent(false, false)]
local procedure OnBeforeTransferJobPlanningLineToItemJournalLineReservationEntry(var JobPlanningLine: Record "Job Planning Line"; var ItemJournalLine: Record "Item Journal Line"; var OldReservationEntry: Record "Reservation Entry"; var TransferQty: Decimal; var IsHandled: Boolean);
begin
end;

Internal work item: AB#626514

Metadata

Metadata

Assignees

No one assigned

    Labels

    SCMGitHub request for SCM areaevent-requestRequest for adding an event

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions