Unleashing Dynamics 365 Excellence: Your Source for Pro Tips and Snippets at D365Snippets.com

Our blog provides a curated collection of tips, tricks, and code snippets that streamline your workflow and enhance your proficiency.
Unleashing Dynamics 365 Excellence: Your Source for Pro Tips and Snippets at D365Snippets.com

How to Add a New Field to An Existing Tabel in Dynamics 365 Finance and Operations

0

In the previous article, we already discussed The model management in dynamics 365 F&O. In this article I will show how to add a new field to an existing table in dynamics 365 finance and operations. In most dynamics 365 finance and operations development, this is a common scenario.

How do achieve this task? is it possible to change the structure of existing base tables in dynamics 365? Yes,  In dynamics 365 this task is achieved by using the extension method.

An extension is a way to add functionality to an existing 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. 

how-to-add-a-new-field-to-an-existing-tabel-in-dynamics-365-finance-and-operations
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 overlaying of SYS layer code.

Here I am showing you how to add one new field to the already existing CustTable by using Extension methods. A new remarks field to the CustTable.

If you are a beginner or new to dynamics 365 Finance & Operations, you can use Microsoft's Free Virtual Machine. Learn How to Set Up a Free Virtual Machine for Dynamics 365 Development.

How to do it

Create a model

  • Under the Dynamics 365 menu, choose Model Management | Create model...
  • The Model name is SalesModel and fill all the required fields with your values as shown in the below figure.


How to Add a New Field to An Existing Tabel in Dynamics 365 Finance and Operations

  • Press the Next button.
  • On the Select package page, choose Select Existing package. We are now offered a list of packages that we can refer to, these are listed as the package's name and the models that the package contains, check Application Suite and
  • Press the Next button.
  • The two checkboxes, Create a new project and Make this my default model for new projects, should both be checked.
  • Press the Finish button.
  • This opens the New Project dialog. The project name is CustomerModification.
  • Then press the OK button.
  • Now D365 F&O Project is created.

How to Add a New Field to An Existing Tabel in Dynamics 365 Finance and Operations

As we already discussed, adding a new field to an existing table in D365 F&O is achieved through the extension method. so here we are going to extend the existing customer table. In D365FO Customer Master table is named as  CustTable So we are going to extend CustTable.

Extend Table CustTable

  • Open Application Object Tree [AOT]. For this go to View->Application Explorer.
How to Add a New Field to An Existing Tabel in Dynamics 365 Finance and Operations
  • Expand the Data Model node.
  • Under Data Model, Expand Tables. 
  • Search the CustTable.
  • Right Click On CustTable and click Create Extension.
  • After a few seconds, one Folder name TableExtensions and table CustTableExtension1 is created under the Project CustomerModification in Solution Explorer Window.
How to Add a New Field to An Existing Tabel in Dynamics 365 Finance and Operations
  • Double click on CustTable.Extension1.

  • A designer window for CustTable.Extension1 opens.
  • Expand the fields node.
  • Right click on the fields node and select New-->String.
  • The new customer remarks fields are String Data type.
How to Add a New Field to An Existing Tabel in Dynamics 365 Finance and Operations
  • One string field is created name FieldString1.
  • Right Click FieldString1 and go to Properties and change the Name Properties to "CustRemarks"
  • Change Extended Data Type to the description.
  • Change the Label Property to "Remarks".
How to Add a New Field to An Existing Tabel in Dynamics 365 Finance and Operations

Now Build the project by right-clicking the Project name from Solution Explorer. Only After the build process, this change is reflected in the Database level. Now table level customization is completed.

In the next article, I will show you how to add a new field in the table and add this field to the form.

if this article is useful, please share it on social media. 

Labels

How do I add a new field in Dynamics 365?
How do I add a field in dynamics?
How do I add a field to a view in Dynamics 365?
How do I add a field in navigation?
How many types of fields are there in Dynamics 365?
How do I change the primary field in Dynamics 365?
How to add a new method in table extension in d365
Adding custom fields in dynamics 365 for finance and operations
Customization in dynamics 365 finance and operations.

Post a Comment

0Comments
Post a Comment (0)