Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

Enums and EDTs best practices

(0) ShareShare
ReportReport
Posted on by 1,309
Hi,
 
When creating an enum, is it better to create an EDT for it as well and specify the enum type
 
and when adding a field to the table, then we'll put the EDT as extended data type 
 
Or shall we just create the enum alone. And add this enum to the table as a field?
  • Suggested answer
    GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 on at
    Enums and EDTs best practices
    Hi,
     
    It depends on the situation. For example, for one field you need to set the label as "Test". For other fields you need to set the label as Test1.
    In that case you can create a Enum with label as "Test". On the other hand, if you want "Test1" then create an EDT and mention the label as "Test1" and set the Enum type property.
    Similarly, its applicable to configuration key, help text etc. also.
    For example, you can refer to EDT "ABCModelType" where there is a configuration key mentioned. On the other hand, when you see the base Enum ABCModel there is no configuration key mapped. Both this EDT and Enum are used in different tables based on the requirement.
     
    Thanks,
    Girish S.
  • .. Profile Picture
    .. 1,309 on at
    Enums and EDTs best practices
    Hi Andre,
     
    Yes I looked at a standard example and the enum was used directly. However, for example there is NoYesId EDT related to NoYesEnum.
     
    Currently I created a new Enum, so I'm not sure if I should create an EDT and link it to the field. Or shall i use the enum directly? What do you think? Since it's a new enum, then i think the label i will put for the enum is the same label I want to use for the field or what?
     
     
    Also what is configuration key?
  • Suggested answer
    André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,965 Super User 2025 Season 1 on at
    Enums and EDTs best practices
    Hi IntegrationBeginner,
     
    This depends on the exact use case. When you look at e.g. the AssetType, then the enum is directly used. In cases where e.g. the label or configuration key should be different, you can create the EDT based on the enum.

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,965 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,817 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans