You are on page 1of 5

Extensible Control in Dynamic 365 FinOps

by Saim Siddiqui

Do you have ever need of a control that Microsoft didn’t build?

Why don’t you create for yourself then?


So, we can create our own new control by using Control Extensibility Framework. You can use the same
tools that Microsoft uses to build controls that are already present in the program.
For creating your own custom control three major relics are involved in the process of developing an
extensible control:

• X++ build class


• X++ run-time class
• HTML and JavaScript

X++ build class

This class will let you define the properties of the control which you usually saw in the property section
of control. This class is consumed by the run-time class to initialize the state of the control based on the
value of properties.

X++ run-time class

This class will let you define the server-side logic and data access code for your control.

HTML and JavaScript

As dynamic 365 finops is web-based application so for visualization we will use HTML, CSS, JS to
create visualization of control.
Scenario:
Embedding Power BI report into form of the dynamics.

First, we need to create class which will extend the FormBuildControl.

[FormDesignControlAttribute('ExtensibleControl')]
class ExtCtrlDemoBuild extends FormBuildControl
{

Now I am creating an HTML file with extension with .htm (not .html) resource file for the html
part where you will put your html part. Here I am putting <iframe>
Now I am creating the resource file: Add new item> Label and resources> Resource
and adding this html file.
Now I am creating a class which will extends the FormTemplateControl

Where we will referred the our controls/resources.

[FormControlAttribute('ExtensibleControl','/Resources/html/Control',
classStr(ExtCtrlDemoBuild))]
class ExtCtrlDemoControl extends FormTemplateControl
{
public void new(FormBuildControl _build, FormRun _formRun)
{
super(_build, _formRun);

this.setTemplateId('ExtensibleControl');
this.setResourceBundleName('/Resources/html/Control');
}

Now you can find your custom control on form section


Add this to your form and your control is all there

You might also like