Codeunit 2847 Cost Adj. Sch. Notif. Handler

App
Base Application
Namespace
Microsoft.Inventory.Costing
Versions
18-28

Procedures, 3

Versions171819202122232425262728

Source29

Source in 29

src/Layers/W1/BaseApp/Inventory/Costing/CostAdjSchNotifHandler.Codeunit.al44 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.Inventory.Costing;

using Microsoft.Inventory.Setup;

codeunit 2847 "Cost Adj. Sch. Notif. Handler"
{
    var
        SchedulingManager: Codeunit "Cost Adj. Scheduling Manager";
        LearnMoreLinkLbl: Label 'https://go.microsoft.com/fwlink/?linkid=2148858';

    procedure ShouldDisplayNotification(Rec: Record "Inventory Setup"; xRec: Record "Inventory Setup"): Boolean
    begin
        if
            xRec."Automatic Cost Posting" and
            not Rec."Automatic Cost Posting" and
            not SchedulingManager.PostInvCostToGLJobQueueExists()
        then
            exit(true);

        if
            (xRec."Automatic Cost Adjustment" <> Rec."Automatic Cost Adjustment"::Never) and
            (Rec."Automatic Cost Adjustment" = Rec."Automatic Cost Adjustment"::Never) and
            not SchedulingManager.AdjCostJobQueueExists()
        then
            exit(true);

        exit(false);
    end;

    procedure OnActionSchedule()
    begin
        Page.RunModal(Page::"Cost Adj. Scheduling Wizard");
    end;

    procedure OnActionLearnMore()
    begin
        Hyperlink(LearnMoreLinkLbl);
    end;
}