Technical intro to Feature management in D365FO

Feature management is an alternative to configuration keys for releasing and introduce a new features into D365FO. 

MS is still releasing updates around the framework but the existing state as per 10.0.9 provide all we need to get started with releasing functionality that is controlled by the feature management framework. 

The key to the feature framework is the feature class, in my example below see the class pekTestingFeature. It is used as a descriptor for the feature and the flag to indicate if the feature is enabled or not. Once the class is created and compiled, users can navigate to Feature management under System administration and enabled/disable the feature. It is possible to make a feature enabled by default or disable the possibility to disable the feature. If the feature doesn't automatically appear, run the Check for updates button.  


The feature class can be applied to menu items and menus. If enabled the menu item or menu will be visible to the user through the front end, otherwise it will be invisible. 


Code can also be controlled by verifying if the feature is enabled just like with configuration keys, FeatureStateProvider::isFeatureEnabled(::instance());

See classes pekCalculateSomeThing and pekFeatureManagementVisibilityManager below. 

A key difference between features and configuration keys is that features are by default not enabled. 

When using gated check in on a build server the tests will fail when testing functionality that is controlled by the feature class unless the feature is enabled on the build VM. To solve this problem MS has provided a new attribute that can be applied at class level on your test class to ensure that a specific feature is enabled or disabled, SysTestFeatureDependency(classStr(FeatureA), )

See unit testing code example below in classes pekCalculateSomeThingFeatureEnabled and pekCalculateSomeThingFeatureDisabled

Code for download can be found in this git repo https://github.com/ponekbladh/d365foblog



Comments

Popular posts from this blog

How to disable auto enabled flight key using KillSwitch

Continuous integration and deployment Power platform FinOps tweaking