It seems that it is very common here to use the mobile number to search for existing clients. In the past I had fields for First Name, Last Name, Phone and Email.
For the current project, I want to simplify it and just have two fields email and phone number.
I always save the email in all lowercase, so searching it is predictive.
But how do I rationalise the phone numbers? I know the NZ system well, but I am sort of new here.
Obviously 04 is mobile. But can I assume that any number starting with 4 should have a 0 prepended ?
What about landlines ? Do I insist that they enter an area-code when the number does not start with a 0?
You can’t make that assumption, unless there are nine digits entered in the search. If it is an incremental search, you may be able to do an OR
People either enter just their phone number or area code and phone number. People always include the 0 in the area code. If the area code is not included people would assume the local area code - like the phone system does.
I would suggest google libphonenumber but the only way for Delphi to use it is to use a wrapper and the only one I have came across is LibPhonenumber-for-Delphi, which uses the C# .Net port of the library (with no source dlls? )