OpenFeature for AL is created to popularise the feature flag-driven development among Dynamics 365 Business Central community by providing a workable tool to manage it.
git clone -b release/PTE https://github.com/thetanz/OpenFeature-al.git
, package extension from MAIN
folder and deploy to your On-Prem environment.{
"id": "c42f2379-d7b5-4378-8ce4-9bca293c6189",
"publisher": "Theta Systems Limited",
"name": "OpenFeature",
"version": "3.4.0.0"
}
OpenFeature
extension allows the development team to manage feature flags. When the feature is enabled, the extension appends ApplicationArea with enabled feature identifiers.
Use your feature identifier as an ApplicationArea
for all feature-related page controls and actions. Example:
field(StripeID; Rec.StripeID)
{
Caption = 'Stripe ID';
ToolTip = 'Customer''s Stripe ID';
ApplicationArea = Stripe;
}
Wrap feature-related code block into a condition. It's recommended to use IsEnabled
function from FeatureMgt_FF_TSL
codeunit. Example:
if FeatureMgt.IsEnabled('Stripe') then
// Feature 'Stripe' is enabled
StripeClient.CreateInvoice(SalesHeader);
OpenFeature extension uses Providers
to manage features as well as their states.
ConditionProvider_FF_TSL
codeunit enables any extension to add features with conditions. Example:
// Add new feature with condition to be enabled only for users with email ending with '.nz'.
ConditionProvider.AddFeature('Stripe', '[Enables Stripe Integration](https://example.com/Stripe)');
User.SetFilter("Contact Email", '*.nz');
ConditionProvider.AddCondition('NZUserOnly', ConditionFunction_FF_TSL::UserFilter, User.GetView());
ConditionProvider.AddFeatureCondition('Stripe', 'NZUserOnly');
As introduced, conditions could be modified by any user with Feature Mgt. - Admin
permission set assigned.
PostHogProvider_FF_TSL
codeunit enables integration with PostHog Feature Flags service which will mirror enabled features within your Business Central environment. Setup example:
// App PostHog provider. It will load all available features automatically.
ISecretProvider := SecretProvider;
ISecretProvider.GetSecret('PostHogPersonalAPIKey', PersonalAPIKey);
ISecretProvider.GetSecret('PostHogProjectID', ProjectID);
if not PostHogProvider.AddProvider('THETA_POSTHOG', PersonalAPIKey, ProjectID) then
Error(GetLastErrorText());
See the open issues for a list of proposed features (and known issues).
OpenFeature for AL licensed under GNU Lesser General Public License version 3 (LGPL-3.0). Key features of the LGPL-3.0 include:
Contributions make the open-source community a fantastic place to learn, inspire, and create. Any contributions you make are greatly appreciated.
git checkout -b feature/AmazingFeature
)git commit -m 'Add some AmazingFeature'
)git push origin feature/AmazingFeature
)