+ Start a Discussion

Anyone written a class to use libphonenumber?

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.




Have you find a solution to this point ?





Not yet.

I should rather have asked, has anybody stored the Javascript version of libphonenumber as a static resource and used it to add phone validation/formatting correction to Visualforce pages. We are having a go with that just now but I'd be interested to hearn from others' experiences.

Did you have any luck getting this to work?
Dmitriy JediDmitriy Jedi
https://github.com/kumarrk21/ZPhoneFormatter - ZPhoneFormatter.js file, Works fine for VF
Igor Petrovych 4Igor Petrovych 4
Hey! Replied in your trailbrazer's thread, but also letting everyone know here. We have ported the libphonenumber library to Salesforce (Apex) and it's available for free (https://appexchange.salesforce.com/appxListingDetail?listingId=a0N3A00000G12oJUAR). Since it's an apex solution you can use it and make any custom component you'd like to format/validate your number. In case you have any issues or need some help don't hesitate to contact me or our team at Noltic (https://noltic.com/).
Larry Wolf (CRM)Larry Wolf (CRM)
I can confirm the libphonenumber package mentioned in prior comment works for our salesforce/libphone Apex needs. Note it does seem to be a bit CPU heavy, so you would likely want to limit it to a single update at a time rather than try it with bulk updates.
Igor Petrovych 4Igor Petrovych 4
May be you can send me (ipetrovych@noltic.com) sample of your code, of what features you are using and what version of libphonenumber you are using? The latest version was optimized to perform much better, yet I do confirm that the library uses some CPU. We are looking to optimize it further.