Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Finance forum / Restrict special chara...
Finance forum
Suggested answer

Restrict special characters in Invoice Number field

Posted on by 12
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. 
Categories:
  • Hana Xue Profile Picture
    Hana Xue 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
    Waed Ayyad 5,451 Super User 2024 Season 2 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
    Hana Xue 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
    BillurSamdancioglu 13,894 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
    Mohamed Amine Mahmoudi 9,314 Super User 2024 Season 2 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
    Ramit Paul 20,819 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
    MuthukumaranAX 2,899 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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,524 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,493 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans