Skip to main content
Business Central forum
Suggested answer

field should only accept number

editSubscribe (2) 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?
 
 
Categories:
Attachments
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 60,471 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.
     
     
    Thanks.
    ZHU
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    Mohamed Amine Mahmoudi 4,118 User Group Leader 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
  • Suggested answer
    Mohana Yadav Profile Picture
    Mohana Yadav 45,264 Super User on at

Helpful resources

Quick Links

New Blog Features Released!

Check out the new community blog features for viewers and authors…

Demystifying Copilot with Sundar Raghavan

Sundar explains how Copilot for Service is meant to function separately...

Business Process Guidance Badges and New…

The Microsoft Success by Design is the framework for implementing Dynamics 365…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,266 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 222,978 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,140

Featured topics

Product updates

Dynamics 365 release plans