Skip to main content



No record found.

Business Central forum

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 64,134 Super User 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.
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    Mohamed Amine Mahmoudi 7,292 User Group Leader on at
    field should only accept number
    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 50,405 Super User on at

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .


André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,986 Super User

Martin Dráb Profile Picture

Martin Dráb 225,588 Super User

nmaenpaa Profile Picture

nmaenpaa 101,148


Featured topics

Product updates

Dynamics 365 release plans