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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Real field mandatory but should allow 0

(0) ShareShare
ReportReport
Posted on by 114
Hello,
 
I have a  real field that is mandatory. How can I allow it to insert 0 as a value and not look into that 0 as empty? When I put "show zero" property to No, whenever I enter 0 in the field it resets to empty.
So the requirement is to be mandatory but being able to enter 0, so to distinguish between empty (null) value and 0 as value.
Is this possible in X++?
 
Thanks in advance
Categories:
I have the same question (0)
  • Sohaib Cheema Profile Picture
    49,668 Super User 2026 Season 1 on at
    Hi,
     
    In x++ real number 0.0 is treated as null (in other words there is no Null) You can read it here: https://learn.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/dev-ref/xpp-variables-data-types#null-values-for-data-types
     
    If you can describe your business problem(without talking about code), someone may suggest a solution.
     
  • Suggested answer
    Martin Dráb Profile Picture
    239,660 Most Valuable Professional on at
    It's impossible. You're wrong in thinking that a real field can contain null. A real field is considered empty if its value is zero; whether you see the number or an empty field is just the matter of visualization.
     
    If you make it mandatory, you're saying that it mustn't be zero. If you want to accept zero, it can't be mandatory. You can't allow and disallow zero at the same time.
     
    You can implement such behavior, but you'll need an extra piece of information saying whether the field is considered empty or zero. Such as an additional boolean field (and you'll allow edition of the real field only when the boolean field is true).

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 Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 676

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 635 Super User 2026 Season 1

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 605 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans