web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Forums / Finance forum / Extending an EDT vs de...
Finance forum

Extending an EDT vs deriving it from an existing EDT

(0) ShareShare
ReportReport
Posted on by 325

Hi dear community,

At the bottom of the reference page for modifying EDTs here by extensions it mentions the following tip:

Tip: Instead of extending an existing EDT, you can create a new one, deriving it from the existing EDT. This allows you to edit more properties than you could edit using the extension approach. This means that you would need to modify the fields using this EDT to use your new EDT.

How would we do this in Visual studio? And is there a reason why we would not use this new method instead of extensions, it seems like by deriving from an existing 
EDT I have the liberty of changing whatever property I want versus the extensions in which I can only change few properties (label, help text etc)

Thanks in advance

I have the same question (0)
  • Suggested answer
    Martin Dráb Profile Picture
    240,020 Most Valuable Professional on at

    You create a new EDT (of the same base type) and then set the same of the parent type into Extends property.

    It's important two realize that you'll end up with two EDTs. You can use the new one for your new fields, but all the existing fields will keep using the original EDT. If you create an extension instead and change a property, even the standard fields will start behaving different

  • MohammadBB Profile Picture
    325 on at

    Hi Martin,

    Thanks for the answer, it was helpful. what do you mean by standard fields will behave differently? As far as I know all the field except the ones here cannot be changed and they will stay intact:

    - Label

    - Help text

    - Form help

    - Country region codes

    - String size

    Thanks for clarifying.

  • Suggested answer
    Martin Dráb Profile Picture
    240,020 Most Valuable Professional on at

    Let's say we're talking about ItemId EDT. If you create a new type MyItemId and change its label, it'll have no impact to fields using ItemId EDT. But if you create an extension of ItemId and change the label, all fields and form controls bound to ItemId EDT will show the new label.

    Which technique you should use clearly depends on what you want to achieve.

  • MohammadBB Profile Picture
    325 on at

    thanks again for the answer, I am a newbie to the D365 FO world and have a lot of questions on concepts.

    I see the same idea on the tables as well where you can either inherit from a table or extend an existing one. I see in the tutorial I am following that it uses inheritance in cases where we become more and more specific in our object hierarchy i.e. CarTable inherits from VehicleTable because Car "Is a" vehicle. Also for extending I see that it is used in cases where we want to add more functionality to an existing table i.e.  the customer table is extended in design and logic for a specific module say a Reverse Logistics management module.

    So is this the same approach compared to an EDT derivation and extension? if so, is there a clear line where we would use the former (derivation or inheritance) versus the latter (extension)?

  • Martin Dráb Profile Picture
    240,020 Most Valuable Professional on at

    Logically it's the same thing, but it's much more complicated with tables. It requires careful design, especially if you write queries or design forms that may show different children. Not many tables support it;

    table inheritance is much less common than inheritance of EDTs or classes.

    As I explain with EDTs, changing a table (e.g. adding a field to an existing table) or creating a new table (inheriting something from its parent) are two completely different things. You won't create a table when you want add a field to an existing table and you won't change an existing table if you want to create a new one. You'll choose the technique that does what you need; they're not two different ways for achieving the same result.

  • Don Shields Profile Picture
    650 on at

    Is there still no way to increase the field length for a string EDT Like we could in AX 2012?

  • Martin Dráb Profile Picture
    240,020 Most Valuable Professional on at

    There is - EDT extensions support it for a long time.

  • Don Shields Profile Picture
    650 on at

    Thanks for the reply.  I was speaking specifically about he String size property.  When I create an extension on RouteOprId extended data type I am not able to expand the string size.  Is there a way to do that now?  I am also not able to modify the Extends property.

    Best Regards,

    Don Shields

  • Martin Dráb Profile Picture
    240,020 Most Valuable Professional on at

    This isn't related to extensions. You couldn't change String Size of RouteOprId through overlayering either, because it's inherited from the parent EDT.

  • Don Shields Profile Picture
    650 on at

    Correct to your point and since I cannot change the Extends property via extension then this is not possible to do correct?

    Regards,

    Don

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Finance

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans