You need to sign in to do that
Don't have an account?
CloudPower
Validation rule to check if the string contains all the special characters.
Hi,
I need to create a VR inorder to throw an error when tried to save a custom field of type string with all special characters in it.
Ex: CustomField__c = '@@@@$$$%%';
In other words i dont want a field to save with only special characters in it. The special characters can exists in combination with alphanumeric characters but cant exists independantly.
Tried using ReGEX but couldn't succeed .
Please provide if any soln.
Thanks
Hi,
Try the below formula condition in validation rule as reference:
OR( ISNUMBER(Name), OR(CONTAINS(Name, "!"),CONTAINS(Name, "@"),CONTAINS(Name, "#"),CONTAINS(Name, "$"),CONTAINS(Name, "$"),CONTAINS(Name, "%"),CONTAINS(Name, "^"),CONTAINS(Name, "&"),CONTAINS(Name, "*")))
Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.
Thanks for the reply Navatar.
The Validation rule works fine if the string(Name) contains any special characters but here my requirement is to allow the special characters in combination with alpahanumeric characters and avoid if the string contains only special characters without any alphanumeric characters in it.
Ex:
Name = '@@@@@@####';(Dont allow)
Name = '@@@@@@####123aqQ';(Allow)
Can anyone suggest other work around for this scenario?