How to extend an EDT in Dynamics 365 Finance & Operations (D365FO)

Posted by Sam on Wednesday, May 25, 2022

Showing how to extend or customize an EDT in Dynamics 365 Finance & Operations (D365FO)

Introduction

It is a common request to increase the size of a field. In this post, we will explore how you can do that in D365FO as well as note some impacts of EDT size change.

Note: The prerequisite is that you’ve already known how to create a model, a Dynamics 365 project in Visual Studio to follow along the below steps.

How to Increase String Size of a Standard EDT

EDT String Size can be extended under some circumstances.

For instance, I assume the table/ form field that you might want to extend is derived from EDT EcoResProductNumber which has the standard string size of 20.

Example EDT is EcoResProductNumber

This one does not extend from another EDT so it’s possible to modify its string size via extension.

If the EDT that you want to customize is not a base EDT (and the String Size property is grey out), you will need to find the base EDT that allows to extend String Size property

Create extension of EcoResProductNumber

In my extended EDT, I can change the string size to 50.

In the extended EDT, changing String Size property from 20 to 50

I can build and sync successfully. Then I can verify the change by looking at a standard table that uses this EDT e.g. EcoResProductIdentifier.

Look at a standard table that uses this EDT e.g. EcoResProductIdentifier.

Before extension, the column size is 20.

ProductNumber column of EcoResProductIdentifier table has size 20 before extension

After extension, the column size is increased to 50.

ProductNumber column of EcoResProductIdentifier table has size 50 after extension

Hope that my inputs meet your requirements. Your exact EDT might be different, however, the approach is the same. If the EDT is like a base one (does not extend from another EDT) then you can increase its string size via extension.

Impacts

Regarding the impacts, the extension models of D365FO means that when you change a base element, the changes will be applied to all derived elements.

Per the documents, It is noted that when you change the number of decimals or string size for one EDT, the values on all derived extended data types will follow. For example, EcoResProductNumber EDT, you can Find References to see if any EDTs are derived from it. In my lab of 10.0.24, it seems none.

find references of  EcoResProductNumber EDT

One rare scenario that I encountered in the past is some customers’ dev team increases the size significantly for several EDTs to quite an extreme number, we may encounter a size exceeding error. For example this one was reported before: “The total, internal size of the records in your joined SELECT statement is 222158 bytes, but Microsoft Dynamics 365 for Finance and Operations is by default performance-tuned not to exceed 196608 bytes”.  In that case, the String size for DimensionValue EDT was changed from 30 to 500. The abnormal size of the extended EDTs caused some queries to exceed the limit of an allowed statement.

Generally, it does not create any significant impacts in terms of performance (for example, in your case, from 20 to 50 is not a huge increase in size). This is still a key impact to be aware of because all derived EDTs will change as well. So before implementing any changes, you can evaluate the area of impacts (how many EDTs size will subsequently be changed) and whether the increase is reasonable.

Moreover, instead of extending a standard EDT (what you can modify via extension is limited), after evaluating the EDT, you might find creating a new one to have more flexibility. The final decision varies and depends on each scenario’s requirements.

Does the change affect ISV?

Question: My customer have multiple custom models, If I extend string size of EDT at one model A, will the EDT at another model B be impacted? In some cases, model B can be a binary ISV package so I cannot directly see the model B’s source code or modify it.

Answer: For compiled model e.g. model B, when you extend EDT in model A and build model A in DEV, it will not rebuild model B. However, as the D365FO extension models means that the child EDTs always inherit the string size from its parent EDT.  During DB Sync, SQL will pick up the highest size to apply to the parent EDT and its derived EDTs.

So, for example, your model B is a compiled ISV model.

  • Model B extends EcoResProductNumber EDT string size from 20 to 30. Also, model B even creates a custom EDT called ExtB_EcoResProductNumber that extends from the base EcoResProductNumber EDT. When we only build and sync model B in a system, the string size of EcoResProductNumber and ExtB_EcoResProductNumber will be 30.
  • Model A then extends EcoResProductNumber EDT string size from 20 to 50. After full build and DBSync, SQL will still pick up the highest value and apply this change to all related elements. As a result, your system (which has both model A and B) will have EcoResProductNumber EDT and ExtB_EcoResProductNumber string size of 50, not 30.

References