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
chokchok 

Tax id validation rule

Hi,

 

I need to validate tax id field with out being junk.

For example it cant be 9999999999 or 2222222222 or 3333333333.

I know we have to use regex function for particula format but all numbers cant be same

 

 

Thanks

Best Answer chosen by Admin (Salesforce Developers) 
Akhilesh.jaipurAkhilesh.jaipur

Hi,

 

while using regx its very easy to implement

 

REGEX(fieldName, "[0]{4,}|[1]{4,}|[2]{4,}|[3]{4,}|[4]{4,}|[5]{4,}|[6]{4,}|[7]{4,}|[8]{4,}|[9]{4,}")

 

will report you whenever user tries to enter similar digits more than 3 times

 

if you want to allow less or more repetitive chars then simply change the " {4,} " to like "{3,}" only two same chars or "{6,}" for 5 same chars

 

 

Thanks

Akhilesh