Codeunit 315 Sales Inv.-Printed

Base Application, Microsoft.Sales.History

src/Layers/W1/BaseApp/Sales/History/SalesInvPrinted.Codeunit.al49 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.Sales.History;/// <summary>/// Updates the print counter on posted sales invoice headers when documents are printed./// </summary>codeunit 315 "Sales Inv.-Printed"{    Permissions = TableData "Sales Invoice Header" = rimd;    TableNo = "Sales Invoice Header";    trigger OnRun()    begin        OnBeforeOnRun(Rec, SuppressCommit);        Rec.Find();        Rec."No. Printed" := Rec."No. Printed" + 1;        OnBeforeModify(Rec);        Rec.Modify();        if not SuppressCommit then            Commit();    end;    var        SuppressCommit: Boolean;    /// <summary>    /// Sets whether the commit operation should be suppressed after updating the print counter.    /// </summary>    /// <param name="NewSuppressCommit">Specifies whether to suppress the commit operation.</param>    procedure SetSuppressCommit(NewSuppressCommit: Boolean)    begin        SuppressCommit := NewSuppressCommit;    end;    [IntegrationEvent(false, false)]    local procedure OnBeforeModify(var SalesInvoiceHeader: Record "Sales Invoice Header")    begin    end;    [IntegrationEvent(false, false)]    local procedure OnBeforeOnRun(var SalesInvoiceHeader: Record "Sales Invoice Header"; var SuppressCommit: Boolean)    begin    end;}