Skip to main content
Dynamics 365 Community / Forums / Finance forum / Restrict special chara...
Finance forum
Suggested answer

Restrict special characters in Invoice Number field

editSubscribe (0) ShareShare
ReportReport
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:
Attachments
  • 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 2,003 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,138 Super User 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 3,641 UG Leader 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 18,201 Super User 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,893 on at
    Restrict special characters in Invoice Number field
    Please take a look at the below post 
     

Helpful resources

Quick Links

New Blog Features Released!

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

Setting Up Knowledge Sources for Copilot…

Look at how configuring a comprehensive knowledge base is crucial…

Demystifying Copilot with Georg Glantschnig…

Industry experts answer burning questions directly from our amazing Community…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 222,689 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,138

Featured topics

Product updates

Dynamics 365 release plans