Notifications
Announcements
No record found.
How to: Validate special characters in a filed that are not allow only alpha numeric value it accepts
*This post is locked for comments
Hi,
you can make use of Regex expressions(System.Text.RegularExpressions.Regex). Have a look at an example shown in an old post.
community.dynamics.com/.../171654
additionally if you will search about regex expressions, you can find lot of material on it.
Define all special characters in a list. Use strContains function by iterating through the list.
Hi Vinay,
You can solve it with coding. You can call Regular Expressions. How to use this can be found in an example: WinAPI::isFileNameValid OR SysEmailDistributor::validateEmail
If you need to know more about regular expressions, you can learn on this site: http://regexr.com/
i have a simple field "name" edt is string 30 ...i have a simple form in that name field sholud not allow any special char.. so i write the validate method in table but its not working they are accepting all the character .. can u give me a example regrading this how to use it....
i have written the code in the table
public boolean validateField(FieldId _fieldIdToCheck)
{
String30 teachername;
boolean ret;
ret = super(_fieldIdToCheck);
if(ret)
switch (_fieldIdToCheck)
case fieldNum (Validationtale,teachername):
if(strContains(teachername,"!@#$%^&*()_+=-[{]};:',<.>/?/-*+"))
Box::info("Special Character Is not Allowed ");
return checkFailed(strFmt("Invaild characters"));
}
else
break;
return ret;
but in form they are accepting the special charc....
@Crispin John Augustine .... it doesnt throw any error also when i am done written it can easily move to the nxt field
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 4 Most Valuable Professional
Priya_K 4
MyDynamicsNAV 2