Skip to main content

Notifications

Community site session details

Community site session details

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

field should only accept number

(1) ShareShare
ReportReport
Posted on by 4
 
I need to create a field that should only accept number. No texts / symbols are allowed.
 
What is the AL code for the same? What is the validation code?
 
 
  • Suggested answer
    YUN ZHU Profile Picture
    81,183 Super User 2025 Season 1 on at
    field should only accept number
    Hi, hope the following helps.
    Dynamics 365 Business Central: How to quickly check whether the value is numeric in AL
    Dynamics 365 Business Central: How to prohibit users from entering illegal characters such as emoji, Hiragana, kanji, etc.
     
     
    Thanks.
    ZHU
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    21,441 Super User 2025 Season 1 on at
    field should only accept number
    Hi,
     
    you can create a field with type integer 
    field(10; number; Integer)
    if you want use Text or Code type you must use Numeric = true
    field(10; number; code[20])
    {
        Numeric = true;
        DataClassification = ToBeClassified;
    }
    Best regards,
    Mohamed Amine MAHMOUDI
  • Verified answer
    Mohana Yadav Profile Picture
    60,209 Super User 2025 Season 1 on at

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,000 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,850 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans