Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

Restrict special characters in Invoice Number field

(1) ShareShare
ReportReport
Posted on by 18
Hello,
 
Is there a way to restrict Users from entering Special characters in the Invoice number field? For instance, when End Users input special characters in the Invoice # field, then, D365 will prompt the User that /special characters' cannot be entered. 
  • Hana Xue Profile Picture
    Microsoft Employee on at
    Restrict special characters in Invoice Number field
    Hi,
    If the answer is helpful, please mark the answer as verified
    Thanks.
    Best Regards,
    Hana
  • Suggested answer
    Waed Ayyad Profile Picture
    8,344 Super User 2025 Season 1 on at
    Restrict special characters in Invoice Number field
    Hi Community member,
     
    As mentioned below you should you regular expression.
     
    Thanks
    Waed Ayyad
  • Suggested answer
    Hana Xue Profile Picture
    Microsoft Employee on at
    Restrict special characters in Invoice Number field
    Hi,
    As mentioned below, you can restrict special characters in the invoice number field by writing custom code, you can also refer to this old thread Solved: How to: Validate special characters? (dynamics.com) 
    Best Regards,
    Hana
  • Suggested answer
    BillurSamdancioglu Profile Picture
    17,153 Most Valuable Professional on at
    Restrict special characters in Invoice Number field
    Unfortunately, can not be done OOB. But with customization, it is doable 
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    22,494 Super User 2025 Season 1 on at
    Restrict special characters in Invoice Number field
    Hi
     
    i think you can use the regex  on validateWrite method
     
    e.g.
     
    public boolean validateWrite()
    
    {
       boolean ret;
       TextBuffer txt = new TextBuffer();
       ret = super(); // if extension use next validateWrite()
       txt.setText(this.InvoiceId);
       txt.regularExpressions(true);
       if (txt.find("^[A-Z 0-9]+$"))
       {
           ret = true;//info("string contains only numbers");
       }
       else
       {
           ret = checkFailed(strFmt(" Conatin the Special Character"));
       }
       return ret;
    }
    Best regards,
    Mohamed Amine Mahmoudi
  • Suggested answer
    Ramit Paul Profile Picture
    22,572 Most Valuable Professional on at
    Restrict special characters in Invoice Number field
    Hi,
     
    There is no standard functionality to mitigate this, you may consider for customization.
     
  • Suggested answer
    MuthukumaranAX Profile Picture
    2,901 on at
    Restrict special characters in Invoice Number field
    Please take a look at the below post 
     

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

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,430 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 233,043 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans