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
BHARAT VYAS SISTABHARAT VYAS SISTA 

how to write validation rule for pancard?

please give me the validation rule for pancard 
it urgent?
NagendraNagendra (Salesforce Developers) 
Hi Bharat,

Please use the below validation rule, Which works fine for me.
NOT( REGEX( PAN_Number__c , "[A-Za-z]{5}[0-9]{4}[A-z]{1}") )
Indian Pan card validation Formula:
NOT( REGEX( PANCARD__c , "((([a-zA-Z]{5})\\d{4})[a-zA-Z]{1})"))
Indian Passport Validation Formula:
NOT( REGEX( PASSPORT_NUMBER__c , "(([a-zA-Z]{1})\\d{7})"))
Hope this will help you with the above issue.

Kindly mark this as solved if the information was helpful.

Thanks,
Nagendra
 
PulaK_PrabhakaRPulaK_PrabhakaR
Hi,
  •  5th character of PAN# can be either one of the following A/B/C/F/G/H/L/J/P/T/K .
  • All alphabet should be in CAPS.
  • Length should be 10
Use:
   OR((NOT(REGEX( ForValidPAN__c , '([A-Z]{5}[0-9]{4}[A-Z]{1})'))), (LEN(ForValidPAN__c )  <> 10),(NOT(OR(MID(ForValidPAN__c, 5, 1)='A',MID(ForValidPAN__c, 5, 1)='B',MID(ForValidPAN__c, 5, 1)='C',MID(ForValidPAN__c, 5, 1)='F',MID(ForValidPAN__c, 5, 1)='G',MID(ForValidPAN__c, 5, 1)='H',MID(ForValidPAN__c, 5, 1)='L',MID(ForValidPAN__c, 5, 1)='J',MID(ForValidPAN__c, 5, 1)='P',MID(ForValidPAN__c, 5, 1)='T',MID(ForValidPAN__c, 5, 1)='K'))))