• Igor Petrovych
  • NEWBIE
  • 0 Points
  • Member since 2017
  • Managing Partner
  • Noltic

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 9
    Replies
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.
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
I am new to the salesforce trying with my first customise validation rule  for the mobile no. as in this format of +91 (XXX) XXX XXXX. I am unable to get this format please any one help me in this scenario 
phone number should accpet only one + symbol at the starting followed by 10 digit number it should not accept +   in the middle or end .
 "^\\D*+([0-9 ]+)*"
 it accepting + symbol at starting .
I'm getting a syntax error when using this in a validation rule,   any ideas ?      NOT( REGEX(Phone,"[0-9\(\)\s\-\+]"))
Hi all,
I need Validation rule for indian format.
I have written this one, but it is raising the error while entering the phone number..
NOT(REGEX,"[7-9]{1}[0-9{9}]")

Please suggest me,
Thanks and Regards,
Anji reddy
Please help me regarding this validation , 
in the phone field we could enter only 10 digit not more or less than 10 digit and not contain any chanracter and i have created a validation which is as follow but in this there is a problem if we enter a number like 1234567891as then it not showing any error and for every condition it is perfect, please help me.
my validation is:
IF (not(isblank(Phone)),OR(NOT(REGEX(Phone , "\\D*?(\\d\\D*?){10}")), NOT(ISNUMBER(Phone))),NULL)
How do I create a validation for phone numbering formatting?  Currently users can enter a US phone number or international number, how can I create a validation rule to format the US phone # and international phone # accordingly?