web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
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. 
I have the same question (0)
  • Suggested answer
    MuthukumaranAX Profile Picture
    2,903 on at
    Please take a look at the below post 
     
  • Suggested answer
    Ramit Paul Profile Picture
    22,809 Most Valuable Professional on at
    Hi,
     
    There is no standard functionality to mitigate this, you may consider for customization.
     
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    26,803 Super User 2026 Season 1 on at
    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
    BillurSamdancioglu Profile Picture
    20,827 Most Valuable Professional on at
    Unfortunately, can not be done OOB. But with customization, it is doable 
  • Suggested answer
    Hana Xue Profile Picture
    Microsoft Employee on at
    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
    Waed Ayyad Profile Picture
    9,135 Super User 2026 Season 1 on at
    Hi Community member,
     
    As mentioned below you should you regular expression.
     
    Thanks
    Waed Ayyad
  • Hana Xue Profile Picture
    Microsoft Employee on at
    Hi,
    If the answer is helpful, please mark the answer as verified
    Thanks.
    Best Regards,
    Hana

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 771

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 629 Super User 2026 Season 1

#3
Subra Profile Picture

Subra 496

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans