Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions src/System Application/App/Feature Configuration/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"id": "4c7e7094-fe3b-43da-970d-1ca056f7f3d3",
"name": "Feature Configuration",
"publisher": "Microsoft",
"brief": "Retrieve feature configuration values from platform",
"description": "Retrieve feature configuration values from platform",
"version": "27.1.0.0",
"privacyStatement": "https://go.microsoft.com/fwlink/?linkid=724009",
"EULA": "https://go.microsoft.com/fwlink/?linkid=2009120",
"help": "https://go.microsoft.com/fwlink/?linkid=2103698",
"url": "https://go.microsoft.com/fwlink/?linkid=724011",
"logo": "",
"dependencies": [
{
"id": "7e3b999e-1182-45d2-8b82-d5127ddba9b2",
"publisher": "Microsoft",
"name": "DotNet Aliases",
"version": "27.1.0.0"
}
],
"internalsVisibleTo": [
],
"screenshots": [],
"platform": "27.0.0.0",
"idRanges": [
{
"from": 8347,
"to": 8348
}
],
"target": "OnPrem",
"contextSensitiveHelpUrl": "https://learn.microsoft.com/dynamics365/business-central/"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------

namespace System.Config;

/// <summary>
/// Feature configuration codeunit to get configuration values for features.
/// </summary>
codeunit 8347 "Feature Configuration"
{
Access = Public;
SingleInstance = true;
InherentEntitlements = X;
InherentPermissions = X;

var
FeatureConfigurationImpl: Codeunit "Feature Configuration Impl.";

/// <summary>
/// Gets the configuration value for the specified key.
/// </summary>
/// <param name="ConfigKey">The configuration key to look up.</param>
/// <returns>The configuration value associated with the specified key.</returns>
procedure GetConfiguration(ConfigKey: Text): Text
var
CallerModuleInfo: ModuleInfo;
begin
NavApp.GetCallerModuleInfo(CallerModuleInfo);
exit(FeatureConfigurationImpl.GetConfiguration(ConfigKey, CallerModuleInfo));
end;

}

Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------

namespace System.Config;

using System;

codeunit 8348 "Feature Configuration Impl."
{
Access = Internal;
SingleInstance = true;
InherentEntitlements = X;
InherentPermissions = X;

procedure GetConfiguration(ConfigKey: Text; var CallerModuleInfo: ModuleInfo): Text
var
ALCopilotFunctions: DotNet ALCopilotFunctions;
CurrentModuleInfo: ModuleInfo;
OnlyMicrosoftAllowedErr: Label 'Only the publisher %1 can access configurations.', Comment = '%1 is the publisher of the calling module.';
begin
NavApp.GetCurrentModuleInfo(CurrentModuleInfo);
if CurrentModuleInfo.Publisher <> CallerModuleInfo.Publisher then
Error(OnlyMicrosoftAllowedErr, CurrentModuleInfo.Publisher);

exit(ALCopilotFunctions.GetConfigurationSetting(ConfigKey));
end;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"id": "5bd255dd-6ec7-46eb-9f3d-137c34baf997",
"name": "Feature Configuration Test Library",
"publisher": "Microsoft",
"brief": "",
"description": "Test library functions for Feature Configuration module",
"version": "27.1.0.0",
"privacyStatement": "https://go.microsoft.com/fwlink/?LinkId=724009",
"EULA": "https://go.microsoft.com/fwlink/?linkid=2009120",
"help": "",
"url": "https://go.microsoft.com/fwlink/?LinkId=724011",
"logo": "",
"dependencies": [
{
"id": "4c7e7094-fe3b-43da-970d-1ca056f7f3d3",
"name": "Feature Configuration",
"publisher": "Microsoft",
"version": "27.1.0.0"
},
{
"id": "7e3b999e-1182-45d2-8b82-d5127ddba9b2",
"name": "DotNet Aliases",
"publisher": "Microsoft",
"version": "27.1.0.0"
}
],
"screenshots": [],
"platform": "27.0.0.0",
"idRanges": [
{
"from": 132515,
"to": 132515
}
],
"target": "OnPrem"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------

namespace System.TestLibraries.Config;

using System;

codeunit 132515 "Feature Config Test Lib."
{

var
ALCopilotFunctions: DotNet ALCopilotFunctions;

/// <summary>
/// Configures the system to use control allocation for A/B testing scenarios.
/// </summary>
/// <remarks>This has no effect in Saas.</remarks>
procedure UseControlAllocation()
begin
ALCopilotFunctions.UseTreatmentAllocation(false);
end;

/// <summary>
/// Configures the system to use treatment allocation for A/B testing scenarios.
/// This has no effect in Saas.
/// </summary>
/// <remarks>This has no effect in Saas.</remarks>
procedure UseTreatmentAllocation()
begin
ALCopilotFunctions.UseTreatmentAllocation(true);
end;
}

Loading