function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Siva SakthiSiva Sakthi 

How to Check the Validation for Fields are Empty or some special character not allowed

Hi,

I have used the text field . I want to add validation for text field below   : NOT(REGEX(Address__c    , "[a-zA-Z0-9,/.\r\n -]+")). but its working fine only given special character.  But we enable the validations means its the mantatory field.  
Note :  I need to check the condition if text field is empty means it should save. How to do that.

Any one guide me to solve this.

Advance Thanks.
Maheshwar
Best Answer chosen by Siva Sakthi
Thiyagarajan Selvaraj (SFDC Developer)Thiyagarajan Selvaraj (SFDC Developer)
Hi Maheshwar,

You could simply add another condition in your validation rule say NOT(ISBLANK(Address__c)) && NOT(REGEX(Address__c    , "[a-zA-Z0-9,/.\r\n -]+"))

All Answers

sandeep sankhlasandeep sankhla
Hi
Please refere below link for all kind of validations..
http://regexlib.com/(X(1)A(fQiXWyUt7cjqORiaRTBs7Zm871EiiKGENq-wimimyhI_Igg3t_alkIOAWxWyfVndZQUwXRipDiGFCFCzfhJMEOtyEmwDu1b9uSa6qTdCSz-g1xZxTt9a8dnz-Ifhqj9EnEQfNcS4cCXFRAIfQU9xCDZzO51Zm5BlaVmB45dLeYKBBM58wlwBMKnspPN_fIxX0))/Search.aspx?k=password&AspxAutoDetectCookieSupport=1

Thanks,
Sandeep
Thiyagarajan Selvaraj (SFDC Developer)Thiyagarajan Selvaraj (SFDC Developer)
Hi Maheshwar,

You could simply add another condition in your validation rule say NOT(ISBLANK(Address__c)) && NOT(REGEX(Address__c    , "[a-zA-Z0-9,/.\r\n -]+"))
This was selected as the best answer