Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Answered

field should only accept number

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
    YUN ZHU 73,565 Super User 2024 Season 2 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
    Mohamed Amine Mahmoudi 9,536 Super User 2024 Season 2 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
    Mohana Yadav 59,137 Super User 2024 Season 2 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans