Part number validation

Hi,

I’m looking to restrict people from entering spaces and special characters (!,@,#,$,%,^,&,*) when creating a part number.

I’m really not too sure how to go about doing this, any guidance would be greatly appropriated.

thank you.

BPM with a regex would be a nice way to accomplish

1 Like

Exactly what we use…

Data directive that has an exception if this code is valid

foreach(var part in ttPart)
{
	if(!new System.Text.RegularExpressions.Regex("^[a-zA-Z0-9_-]*$").IsMatch(part.PartNum))
	{
		return true;
	}
}

return false;

Pierre

4 Likes

Hi Pierre,

Thank you for this. It works great.

Metesh.