web
You’re offline. This is a read only version of the page.
close
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. 
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,797 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,398 Super User 2025 Season 2 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
    19,703 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,039 Super User 2025 Season 2 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 544 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 450 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans