You need to sign in to do that
Don't have an account?

Validation Rule around Phone Number Entry
Hi All,
I am trying to write a validation rule to make sure a phone number is entered in the correct format every time.
A phone number should be entered in the following format:
For Australian Customers - 00 1111 2222
For New Zealand Customers - 00 111 2222
I have been trying to recycle the below code to use with this rule, trying to use the REGEX function but I dont think that works.
Raymond
I am trying to write a validation rule to make sure a phone number is entered in the correct format every time.
A phone number should be entered in the following format:
For Australian Customers - 00 1111 2222
For New Zealand Customers - 00 111 2222
I have been trying to recycle the below code to use with this rule, trying to use the REGEX function but I dont think that works.
OR( AND( OR( ShippingCountry = "VIC", ShippingCountry = "NSW", ShippingCountry = "ACT", ShippingCountry = "QLD", ShippingCountry = "SA", ShippingCountry = "WA", ShippingCountry = "TAS", ShippingCountry = "NT", ShippingCountry = "Australia" ), NOT(ISPICKVAL(CurrencyIsoCode, "AUD")) ), AND( ShippingCountry = "NEW ZEALAND", NOT(ISPICKVAL(CurrencyIsoCode, "NZD")) ) )
Raymond
try this:
For this validation rule, i have created a field mobile validate of text type. the regex can be applied on text type field easily.
If Your shipping country field is of text type try this:
(Type = 'Prospect' && NOT( REGEX( Moblie_validate__c, '[0-9]{2}[ ][0-9]{4}[ ][0-9]{4}'))&& Moblie_validate__c!=null)||
(Type = 'Other' && NOT( REGEX( Moblie_validate__c, '[0-9]{2}[ ][0-9]{3}[ ][0-9]{4}')) && Moblie_validate__c!=null)
If Your shipping country field is of picklist type try this:
(ISPICKVAL( Type , 'Prospect') && NOT( REGEX( Moblie_validate__c, '[0-9]{2}[ ][0-9]{4}[ ][0-9]{4}'))&& Moblie_validate__c!=null)||
(ISPICKVAL( Type , 'Other') && NOT( REGEX( Moblie_validate__c, '[0-9]{2}[ ][0-9]{3}[ ][0-9]{4}')) && Moblie_validate__c!=null)
Thanks
Ankur Saini
http://mirketa.com