Skip to main content

Notifications

Announcements

No record found.

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 47

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
    YUN ZHU Profile Picture
    85,450 Super User 2025 Season 1 on at
    RE: Specify the default value of field type enum?

    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

  • Suggested answer
    Teddy Herryanto (That NAV Guy) Profile Picture
    13,744 Moderator on at
    RE: Specify the default value of field type enum?

    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
    Nitin Verma Profile Picture
    21,569 Moderator on at
    RE: Specify the default value of field type enum?

    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
    Inge M. Bruvik Profile Picture
    1,029 Moderator on at
    RE: Specify the default value of field type enum?

    Have you tried the initvalue property?

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

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

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

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

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 2,655

#2
Mansi Soni Profile Picture

Mansi Soni 1,574

#3
YUN ZHU Profile Picture

YUN ZHU 1,453 Super User 2025 Season 1

Featured topics

Product updates

Dynamics 365 release plans