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

Community site session details

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

Issue with ShowMandatory = true Property for Enum Fields in Business Central

(1) ShareShare
ReportReport
Posted on by 2

Dear Dynamics Community,

I am currently attempting to use the page property ShowMandatory = true to mark an enum field as required on a page. While this property functions correctly for fields of type Code, it does not appear to have any effect when applied to enum fields.

Is there a known limitation regarding the use of ShowMandatory with enum field types? If so, I would greatly appreciate any suggestions or workarounds to achieve similar functionality for enum fields.

Thank you in advance for your support and guidance.

I have the same question (0)
  • Teagen Boll Profile Picture
    40 on at
    Issue with ShowMandatory = true Property for Enum Fields in Business Central
    That might be tricky because ShowMandatory is just looking to see if a field isn't blank then displaying a red asterisk.
     
    You could try using the property NotBlank instead and it will also add the red asterisk and also validate the field. You could then try having one value be None like this:
    enum 50121 Loyalty
    {
        Extensible = true;
        
        value(0; None) { }
        value(1; Bronze) { }
        value(2; Silver) { }
        value(3; Gold)
        {
            Caption = 'Gold Customer';
        }
    }
     
    Then try using either ShowMandatory or NotBlank to see if that flags it as mandatory/validates the field.

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…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

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

#1
Sumit Singh Profile Picture

Sumit Singh 2,163

#2
OussamaSabbouh Profile Picture

OussamaSabbouh 1,908

#3
YUN ZHU Profile Picture

YUN ZHU 1,878 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans