web
You’re offline. This is a read only version of the page.
close
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.

I have the same question (0)
  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,111 Moderator on at

    Have you tried the initvalue property?

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

  • Suggested answer
    Nitin Verma Profile Picture
    21,708 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,284 Super User 2025 Season 2 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
    95,712 Super User 2025 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

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 2,606

#2
YUN ZHU Profile Picture

YUN ZHU 931 Super User 2025 Season 2

#3
Jainam M. Kothari Profile Picture

Jainam M. Kothari 773 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans