- D365FO
- X++
- DateTime
- Dynamics
An extension is a way to add functionality to an object in D365FO without modifying the base code of that object. Your extensions are compiled into their own DLLs, which are separate from the D365 base system libraries.It also makes it easier for Microsoft to patch their SYS layer code.Microsoft has added to allow customization without allowing the base code to be changed, because they plan to not allow any overlayering of SYS layer code.
If you are a beginner or new to dynamics 365 Finance & Operations, you can use Microsoft'f Free Virtual Machine. Learn How to Set Up a Free Virtual Machine for Dynamics 365 Development.
In this article i will show you a simple Customization using D365FO Extension methods, we are going to add one remarks field under Customer Master form.
for this,
1. Create a Model
- Under the Dynamics 365 menu, choose Model Management | Create model....
- The Model name is Sales Model and fill all the required fields with your values.
- As shown in the below figure, you can fill the data
.
Press Next button.
- In the Select package page, choose Select Existing package.
- We are now offered a list of packages that we can refer,
- From the list of check Application Suite and,
- press Next.
- Two check boxes, Create new project & Make this my default model for new projects,
- should both be checked.
- Press Finish.
- This opens the New Project dialog. The project name is CustomerModification.
- Press OK.
Now the project is created.
2. Extend Table CustTable
- Open Application Object Tree [AOT]. For this go to View->Application Explorer.
- Expand Data Model.
- Under Data Model , Expand Tables.
- Search the CustTable.
- Right Click On CustTable and click Create Extension.
- After few seconds one Folder name TableExtensions and table CustTable.Extension1 is creating under the Project CustomerModification in Solution Explorer Window.
- Expand the fields node.
- Right click on the fields node and select New-->String.
- New customer remarks fields is String Data type.
- One string field is creating name FieldString1.
- Right Click FieldString1 and go to Properties and
- change the Name Properties to "CustRemarks"
- Change Extended Data Type to description.
- Change the Label Property to "Remarks".
- Now Build the project by right clicking the Project name from Solution Explorer.
- Only After build process this change is reflect in Database level.
Now table level customization is completed. Next we have to move to form level customization for adding Remarks field in the User Interface.
For this,3. Extend Form CustTable
- Open again Application Object Tree [AOT].
- Expand User Interface Node.
- Under User Interface, Expand Forms.
- Search CustTable Form.
- Right Click On CustTable and click Create Extension.
- After few seconds one Folder name FormExtensions and
- Two table named CustTable.Extension2 is creating under the Project CustomerModification in Solution Explorer Window.
- Double click on CustTable.Extension2.
- Another designer window opens for CustTable.Extension2.
- Add new FormTabControl and change the Name property from property window to "FormTabControl 1", also change the caption property to "Remarks".
- Then add new Field group by right clicking FormTabControl1-->New-->Group.
- Add new String field default name is FormStringControl1.
- Update the label property to "Remarks".
- Set the Data Source Property to CustTable
- And select the Data Field Property to CustRemarks.
- Set MultiLine Property to Yes.
- Build the project again for reflecting the changes. Now the Customization Process in completed.Let us see the output of the customization.
1. Open D365 Functional Environment
2. Open One Customer Record.
3. Expand Remarks Group.
You can see one remarks field is created in customer master form, so here the Customization is Completed.
If you feel this article is useful , try to share this article to your friends, i think this example will help a beginer easy to understand the basic steps of doing customization in dynamics 365 finance and operations.