function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Aditya.ax1199Aditya.ax1199 

Phone Field default value

 

How can i set the defalut value for phone field?

 

I tried following options

1) 000-000-0000

2) (000)-000-0000

 

but i am getting the error.

 

Error: Formula result is data type (Number), incompatible with expected data type (Phone)

 

Best Answer chosen by Admin (Salesforce Developers) 
Navatar_DbSupNavatar_DbSup

Hi,


Try to set below format for assigning the default value put your default value inside the double quotes.
“(000)-000-0000” or “000-000-0000”

 

 

All Answers

Navatar_DbSupNavatar_DbSup

Hi,


Try to set below format for assigning the default value put your default value inside the double quotes.
“(000)-000-0000” or “000-000-0000”

 

 

This was selected as the best answer
Akhil TandonAkhil Tandon
Hi Aditya,

Create a validation on Phone field with below mentioned formula. You can also refer to the link given below.

!REGEX(Phone,"^((\\+1)?\\s?\\(\\d{3}\\)\\s?\\d{3}\\-\\d{4})?$")

https://help.salesforce.com/articleView?id=000213868&type=1

If it helps you, please mark is as best answer, so it will be helpful for other developers.
 
ManjusrinuManjusrinu

 Error: Incorrect argument type for function 'REGEX()'.

What should i do now???