How do you enforce a blank space in a validation rule?

I'm trying to enforce the blank space in the Canadian zip code validation but can't get it to work. Zip code needs to be A9A 9A9, it cannot be A9A9A9.

Here's my syntax:

and(     (NOT(REGEX(Zip_vod__c, "^((?i)[ABCEGHJKLMNPRSTVXY]\\d[A-Z]?\\s?\\d[A-Z]\\d)?"))),      (UPPER($User.Country) = "CA"),      NOT(CONTAINS( $Profile.Name , "INTEGRATION"))  ) 

I've also tried:

and(     (NOT(REGEX(Zip_vod__c, "^((?i)[ABCEGHJKLMNPRSTVXY]\\d[A-Z]?\\ \\d[A-Z]\\d)?"))),      (UPPER($User.Country) = "CA"),      NOT(CONTAINS( $Profile.Name , "INTEGRATION"))  ) 

and:

and(     (NOT(REGEX(Zip_vod__c, "^((?i)[ABCEGHJKLMNPRSTVXY]\\d[A-Z]?\\[blank space]\\d[A-Z]\\d)?"))),      (UPPER($User.Country) = "CA"),      NOT(CONTAINS( $Profile.Name , "INTEGRATION"))  ) 

and:

and(     (NOT(REGEX(Zip_vod__c, "^((?i)[ABCEGHJKLMNPRSTVXY]\\d[A-Z]?\\[]\\d[A-Z]\\d)?"))),      (UPPER($User.Country) = "CA"),      NOT(CONTAINS( $Profile.Name , "INTEGRATION"))  ) 

Replay

Category: formula Time: 2016-07-29 Views: 0

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.118 (s). 12 q(s)