Codeunit 5433 Automation - Apply RSPackage

App
Base Application
Namespace
System.IO
Versions
17-28

Versions171819202122232425262728

Source29

Source in 29

src/Layers/W1/BaseApp/System/RapidStart/AutomationApplyRSPackage.Codeunit.al28 lines, Copyright (c) Microsoft Corporation. MIT

namespace System.IO;

codeunit 5433 "Automation - Apply RSPackage"
{
    TableNo = "Config. Package";

    trigger OnRun()
    var
        ConfigPackageTable: Record "Config. Package Table";
        ConfigPackageMgt: Codeunit "Config. Package Management";
    begin
        Rec.Validate("Apply Status", Rec."Apply Status"::InProgress);
        Clear(Rec."Apply Error");
        Rec.Modify(true);

        ConfigPackageTable.SetRange("Package Code", Rec.Code);
        ConfigPackageMgt.SetHideDialog(true);
        ConfigPackageMgt.ApplyPackage(Rec, ConfigPackageTable, true);

        // refreshing the record as ApplyPackage updated the Configuration package with the number of records in the package, etc.
        Rec.Find();
        Rec.Validate("Apply Status", Rec."Apply Status"::Completed);
        Rec.Modify(true);
        Commit();
    end;
}