Codeunit 1887 Environment Cleanup Impl in 27
- App
- System Application
- Namespace
- System.DataAdministration
Versions171819202122232425262728latest
Source in 27
src/System Application/App/Environment Cleanup/src/EnvironmentCleanupImpl.Codeunit.al51 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 System.DataAdministration;
using System.Environment;
codeunit 1887 "Environment Cleanup Impl"
{
Access = Internal;
InherentEntitlements = X;
InherentPermissions = X;
Permissions = tabledata Company = r;
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Environment Triggers", OnAfterCopyEnvironmentPerDatabase, '', false, false)]
local procedure OnAfterCopyEnvironmentPerDatabase(SourceEnvironmentType: Option Production,Sandbox; SourceEnvironmentName: Text; DestinationEnvironmentType: Option Production,Sandbox; DestinationEnvironmentName: Text)
var
EnvironmentCleanup: Codeunit "Environment Cleanup";
SourceType, DestinationType : Enum "Environment Type";
begin
SourceType := ConvertEnvironmentOptionToEnum(SourceEnvironmentType);
DestinationType := ConvertEnvironmentOptionToEnum(DestinationEnvironmentType);
EnvironmentCleanup.OnClearDatabaseConfig(SourceType, DestinationType);
end;
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Environment Triggers", OnAfterCopyEnvironmentPerCompany, '', false, false)]
local procedure OnAfterCopyEnvironmentPerCompany(SourceEnvironmentType: Option Production,Sandbox; SourceEnvironmentName: Text; DestinationEnvironmentType: Option Production,Sandbox; DestinationEnvironmentName: Text)
var
EnvironmentCleanup: Codeunit "Environment Cleanup";
SourceType, DestinationType : Enum "Environment Type";
begin
SourceType := ConvertEnvironmentOptionToEnum(SourceEnvironmentType);
DestinationType := ConvertEnvironmentOptionToEnum(DestinationEnvironmentType);
EnvironmentCleanup.OnClearCompanyConfig(CompanyName(), SourceType, DestinationType);
end;
local procedure ConvertEnvironmentOptionToEnum(Option: Option Production,Sandbox): Enum "Environment Type"
begin
if Option = Option::Production then
exit(Enum::"Environment Type"::Production)
else
exit(Enum::"Environment Type"::Sandbox)
end;
}