Phone to String Formula Field

Suppose I have Contact Record with FirstName, LastName and Phone, where in phone i am inserting my Mobile no.

e.g. FirstName: ABC
     LastName : XYZ
      Phone   : 9921125797
   MyFormulaField Fomula is = (FirstName+LastName+Phone)

   MyFormulaField : ABCXYZ(992)112-5797 - This is what I get.
   MyFormulaField : ABCXYZ9921125797 - This is what I want.

Any Suggestions !

Answer

Using SUBSTITUTE in a formula field is one way where each character you want to remove (‘(‘, ‘)’, ‘-‘ and ‘ ‘) is replaced by an empty string:

SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(FirstName + LastName + Phone, '(', ''), ')', ''), '-', ''), ' ', '')

Attribution
Source : Link , Question Author : Salesforce Steps , Answer Author : Keith C

Leave a Comment