+ Start a Discussion

Need help to validate vat number format


i need to validate vat number like this format    "IE9X99999X".

here IE is the country prefix.

i have written validation rule  NOT(REGEX( VAT_No__c , "(^(IE)\\[0-9]{1}\\[A-Z]{1}\\d{5}\\[A-Z]{1})?"))).

but it was not taking the input like that format.

any one can u help me.please.







Try NOT(REGEX( Vat_No__c, "^IE[0-9]{1}[A-Z]{1}[0-9]{5}[A-Z]{1}$"))

Thomas Panni 7Thomas Panni 7
How can I create a formula to cover all 27 EU countries? Using the BillingCountryCode field to identify the country from Account address would be an idea, but the formula would exceed the size limit of salesforce formulas. Any ideas?