Create a new Feature in Dynamics 365 F&O

Create a new Feature in Dynamics 365 FO

Create a new Feature in Dynamics 365 F&O

Feature management is a Dynamics 365 Finance and Operations built in dashboard to help system administrators and IT professionals manage, schedule, and view all features available to them given the configurations keys that are enabled in the system.

Microsoft has a regular release cadence for Dynamics 365, with software updates released almost every month. With each new release, new features are added to Dynamics 365. One such new feature has to do with how to manage the other features in D365 — the Feature Management workspace.

There is detailed explanation available on Microsoft Docs. Here is the link. https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/fin-ops/get-started/feature-management/feature-management-overview

This Topics describes how you can create a new feature in Microsoft Dynamics 365 F&O.

We need to define few attribute above the class declaration.

using System.ComponentModel.Composition;
using IFeatureLifecycle = Microsoft.Dynamics.ApplicationPlatform.FeatureExposure.IFeatureLifecycle;
using IFeatureMetadata = Microsoft.Dynamics.ApplicationPlatform.FeatureExposure.IFeatureMetadata;
using FeatureLifecycleStage = Microsoft.Dynamics.ApplicationPlatform.FeatureExposure.FeatureLifecycleStage;
using PlatformStateProvider = Microsoft.Dynamics.ApplicationPlatform.FeatureExposure.FeatureStateProvider;

Declare the class as internal

[ExportAttribute(identifierstr(Microsoft.Dynamics.ApplicationPlatform.FeatureExposure.IFeatureMetadata))]
internal class DemoFeature implements IFeatureLifecycle, IFeatureMetadata
{
}

Now below code should be written inside the class.

private static DemoFeature instance = new DemoFeature();

public static DemoFeature instance()
{
    return instance;
}

Define the label for your Feature

[Hookable(false)]
    public LabelId label()
    {
        return literalStr("Demo Feature);
    }

Define the module

[Hookable(false)]
    public int module()
    {
        return FeatureModuleV0::HRM;
    }

Define the Description or Summary for your label

[Hookable(false)]
    public LabelId summary()
    {
        return literalStr("This feature is created for Demo Purpose");
    }

Display the URL for users/customer to navigate or you can make it empty.

[Hookable(false)]
    public WebSiteURL learnMoreUrl()
    {
        return "https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/fin-ops/get-started/feature-management/feature-management-overview";    
}

Enable the feature by default.

[Hookable(false)]
    public boolean isEnabledByDefault()
    {
        return false;
    }

Make feature disable by user/customer

[Hookable(false)]
    public boolean canDisable()
    {
        return true;
    }

Change Feature Stage to released.

public FeatureLifecycleStage FeatureStage()
    {
        return FeatureLifecycleStage::Released;
    }

Additionally, you can write more methods whether your feature is depends on other feature or all feature.

Once the class is build and compile then you can New feature is available under Feature Management.

If it is not enabled then click on get updates.

image 31
image 30

How to check whether the feature is enabled in code?

Use the isFeatureEnabled method on the FeatureStateProvider class, passing it an instance of the feature class. Example:

if (FeatureStateProvider::isFeatureEnabled(BatchContentionPreventionFeature::instance()))

In this way, We can control the functionality based on feature.

If you need source code then contact me.

Parag Chapre

Parag Chapre is a Microsoft MVP in the fields of Dynamics 365 Finance & Operations, Human Resources, and Power Platform, recognized for his outstanding contributions to the Microsoft Dynamics community.

With over 15 years of hands-on expertise in various Microsoft Dynamics 365 areas, Parag has designed and delivered complex, innovative solutions for customers across industries and geographies. He has also provided leadership and technical guidance to project teams, managed offshore and onshore resources, and worked closely with Microsoft Product teams. Parag is passionate about sharing his knowledge and insights through his personal website, blog posts, articles, and community events. He is a member of the Microsoft Biz Apps Community Advisory Board, a Dynamics 365 Human Resource Community star, a Dynamics 365 Community contributor, and a Dynamics 365 Community Spotlight honoree.

1 Comment

Leave a Reply