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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

From options to enum for base tables

(0) ShareShare
ReportReport
Posted on by
I've a problem in tables "Job Ledger Entry" and "Job journal line" for type field, I can't extend it while it's an option.
Is it possbiel to enumerate them?
I have the same question (0)
  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at

    Unfortunately no... these fields are still Option in the last v16 release and you cannot extend them. They should be replaced as enum in order to be extended.

  • Terrance Morgan Profile Picture
    515 on at

    public virtual int PhoneTypeId

    {

    get

    {

    return (int)this.PhoneType;

    }

    set

    {

    PhoneType = (PhoneTypes)value;

    }

    }

    [EnumDataType(typeof(PhoneTypes))]

    public PhoneTypes PhoneType { get; set; }

    public enum PhoneTypes

    {

    Mobile = 0,

    Home = 1,

    Work = 2,

    Fax = 3,

    Other = 4

    }

    Works like a charm! No need to convert (int)Enum or (Enum)int in code. Just use the enum and ef code first will save the int for you. p.s.: "[EnumDataType(typeof(PhoneTypes))]" attribute is not required, just an extra if you want additional functionality.

    Alternatively, you can do:

    [Required]

    public virtual int PhoneTypeId { get; set; }

    [EnumDataType(typeof(PhoneTypes))]

    public PhoneTypes PhoneType

    {

    get

    {

    return (PhoneTypes)this.PhoneTypeId;

    }

    set

    {

    this.PhoneTypeId = (int)value;

    }

    }

  • Community Member Profile Picture
    on at

    You can use a Table Extension and modify the OptionCaption property. I would only do this for an OnPrem extension though.

  • misterzen Profile Picture
    5 on at

    The idea of this request is to ask Microsoft to modify its development to add the enums. I thought this site was used for that. I made a request to Microsoft Support support.microsoft.com/.../requests

    Maybe there is another site ?

  • Dan Kinsella Profile Picture
    468 on at

    You could try here: github.com/.../issues

    [quote user="misterzen"]

    The idea of this request is to ask Microsoft to modify its development to add the enums. I thought this site was used for that. I made a request to Microsoft Support support.microsoft.com/.../requests

    Maybe there is another site ?

    [/quote]

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

News and Announcements

Season of Giving Solutions is Here!

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,594

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,594

#3
YUN ZHU Profile Picture

YUN ZHU 748 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans