I want to write a validation rule on phone number custom field. I want to check if the phone number cotains the user's iso country code. For example the user creating or updatin the record has its iso country as INDIA. The validation rule must check if the phone number contains +91. I want to write that for many countries.
If we wanted to validate phone numbers in the background, so that they were properly formatted before a user ever saw them in the UI, would one alternative be to use the Java or Python version of the library to write a phone-validation service on Heroku and use Heroku Connect (https://devcenter.heroku.com/articles/herokuconnect) to sync the data with Salesforce?
The libphonenumber code library does a good job normalising and formatting phone numbers to national or international standards - not just for the North American zone but worldwide. Has anyone incorporated the JS version into an Apex class? If so, would you be wiling to post a code sample? This topics seems a bit of a gap in developerforce.