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

Specify the default value of field type enum?

(0) ShareShare
ReportReport
Posted on by 49

Hi, I added a field JOBCat to the customer table and give it an Enum as the following:

enum 50102 JobsCat
{
value(0; "Web Developer")
{
}
value(1; "Mobile Developer")
{
}
value(2; "Desktop Developer")
{
}
value(99; "Jobless")
{
}
}

The problem is all customer affected to the first job in enum, question is how can I specify the job of enum by default?

for example, all customers must have Jobless which has 99 id of enum.

  • Suggested answer
    IB-29041624-0 Profile Picture
    1,191 Moderator on at

    Have you tried the initvalue property?

    learn.microsoft.com/.../devenv-initvalue-property

  • Suggested answer
    Nitin Verma Profile Picture
    21,812 Moderator on at

    Hi,

    Adding More info. If you use InitValue property it will not update existing records instead it will change the values as you are requesting only on new records, to update the existing report, I would prefer the Config. Package or Batch report to update all the records. anyways find the below code it will work for all new customers.

    tableextension 50105 "Modify CustomerCard" extends Customer
    {
        fields
        {
            field(50000; JobCat; Enum JobsCat)
            {
                Caption = 'JobCat';
                InitValue = Jobless;            
                DataClassification = ToBeClassified;
            }
        }
    }
  • Suggested answer
    Teddy Herryanto (That NAV Guy) Profile Picture
    14,306 Super User 2026 Season 1 on at

    The default is set on the table fields that are using the enum using InitValue property. You don't set the default value on the enum object itself.

  • Suggested answer
    YUN ZHU Profile Picture
    103,264 Super User 2026 Season 2 on at

    Hi, hope the following can give you some hints.

    How to set default Account type in General Journals (Customization)

    https://yzhums.com/26385/

    Thanks.

    ZHU

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

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 715 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 452 Super User 2026 Season 2

#3
AndrewThomas81 Profile Picture

AndrewThomas81 371 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans