Codeunit 5914 Invt. Ledger Service Source

App
Base Application
Namespace
Microsoft.Service.History
Versions
26-28

Versions171819202122232425262728

Source29

Source in 29

src/Layers/W1/BaseApp/Service/History/InvtLedgerServiceSource.Codeunit.al28 lines, Copyright (c) Microsoft Corporation. MIT

// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
namespace Microsoft.Service.History;

using Microsoft.Inventory.Ledger;

codeunit 5914 "Invt. Ledger Service Source"
{
    [EventSubscriber(ObjectType::Codeunit, Codeunit::"Invt. Ledger Source Mgt.", OnGetSourceOrderNo, '', true, false)]
    local procedure OnGetSourceOrderNo(DocType: Enum "Item Ledger Document Type"; DocNo: Code[20]; var SourceOrderNo: Code[20])
    var
        ServiceInvoiceHdr: Record "Service Invoice Header";
    begin
        if DocNo = '' then
            exit;

        case DocType of
            DocType::"Service Invoice":
                begin
                    ServiceInvoiceHdr.SetLoadFields("Order No.");
                    if ServiceInvoiceHdr.Get(DocNo) then
                        SourceOrderNo := ServiceInvoiceHdr."Order No.";
                end;
        end;
    end;
}