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

Announcements

No record found.

News and Announcements icon
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?
  • Suggested answer
    Stefano Demiliani Profile Picture
    37,172 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

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 665 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 418 Super User 2026 Season 2

#3
Teagen Boll Profile Picture

Teagen Boll 280 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans