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
SV MSV M 

Auto populate phone as formatted

Hi, I want my phone field to be auto-populated as below after record is saved.
+XX (XXX) XXX-XXXX

I've tried regex to format. But, it's working only if I enter a formatted phone number. Can someone help me how to format the phone upon saving the record... The regex function I used is...
^((\\+)(\\d{2})?\\s?\\(\\d{3}\\)\\s?\\d{3}\\-\\d{4})?$
Thanks in Advance...
AnudeepAnudeep (Salesforce Developers) 
Guess this is answered here