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.
- For On-Prem and local development: Clone PTE release
git clone -b release/PTE https://github.com/thetanz/OpenFeature-al.git
, package extension fromMAIN
folder and deploy to your On-Prem environment. - For SaaS: Follow the link to install OpenFeature extension into your Cloud 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:
- Usage Freedom: Allows free use OpenFeature for AL in any projects, whether those projects are open-source or proprietary.
- Modification Requirements: Requires that any modifications made to the OpenFeature for AL itself be released under the same LGPL terms.
- Linking with Proprietary Software: Allows linking OpenFeature for AL with any proprietary software without requiring the proprietary software to be open-sourced.
Contributions make the open-source community a fantastic place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a pull request
- Owner: @vodyl
- Link: https://github.com/thetanz/OpenFeature-al