+ Start a Discussion

Phone-number validation using libphonenumber in Heroku?

In our org we currently use the Javascript version of libphonenumber (https://github.com/googlei18n/libphonenumber) to validate and correct phone numbers in the Salesforce UI, storing the library as a static resource and calling it from an override page layout, a simple Visualforce page used for the lead object. Validation works very reliably but takes 2-3 seconds, and the override page can cause some unwanted side-effects. Validation allows users to call leads using the Google-built Click-to-Dial softphone built into our Salesforce instance, something out Support team is trialling for a wider launch.

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?
Hello Scott,

I am working on including google libphonenumber in the visualforce page to valdiate a phone nunber. When i download the library from github, the size of file is more than 15 mb. As you know, we can include 5 mb size of file in static resource. I want to refer only javscript not java one in the visualforce. How did you handle this. Can you share your experience. Can you share the piece of vf page where you included libphonenumber related files.

Much appreciated.

Igor Petrovych 4Igor Petrovych 4
Hey! I have good news for you. We have ported the libphonenumber library to Salesforce (Apex) and it's available for free (https://appexchange.salesforce.com/appxListingDetail?listingId=a0N3A00000G12oJUAR). In case you have any issues or need some help don't hesitate to contact me or our team at Noltic (https://noltic.com/).