Have you ever tried to mark an Enum, Option, or Integer field as mandatory in Business Central, but the red asterisk simply refuses to appear—even after setting ShowMandatory = true;?
If yes, you’re not alone
When designing pages in Microsoft Dynamics 365 Business Central, we often want to clearly tell users which fields must be filled in.
In AL, the first property we think of is:
ShowMandatory = true;
This draws the red asterisk next to the field in the UI and visually marks it as required.
But there is a catch.
For numeric, enum, and option fields, you might have noticed that even after setting ShowMandatory = true; the red asterisk doesn’t always behave as expected.
Why does this happen, and how do we fix it?
Let’s walk through it step by step.
The Core Idea
-
For Text fields, “blank” truly means empty – no characters.
-
For Integer, Decimal, Enum, Option, the field always has some value (often
0or the first enum/option member), even when the user hasn’t chosen anything yet.
Business Central therefore doesn’t see these fields as “blank”, so the mandatory indicator behaves differently.
That’s where the BlankZero property helps. It tells Business Central:
“Treat zero or the default value as visually blank for this field.”
When ShowMandatory = true; and BlankZero = true; work together, the red asterisk is shown until the user selects or enters a meaningful value.
Table Extension:
Key points:
Customer Category is an Enum.
Customer Fix Category is Text.
Customer Option Category is an Option with a blank first member.
Customer Category Integer is an Integer.
Enum:
Here, value 0 is intentionally a blank value. This is important because BlankZero uses this default to decide when to treat the field as “empty”.

Like
Report
*This post is locked for comments