08-21-2008 02:21 PM
Currently i'm using this to search for a contact. the find_number is format like this 8001234567
PIM pim = PIM.getInstance(); String[] lists = pim.listPIMLists(PIM.CONTACT_LIST); for (int i = 0; i < lists.length; i++) { BlackBerryContactList list = (BlackBerryContactList)pim.openPIMList(PIM.CONTACT
_LIST, PIM.READ_ONLY, lists[i]); for (Enumeration e = list.items(find_number, BlackBerryContactList.SEARCH_CONTACTS); e.hasMoreElements(); ) { } . . . }
Some users have reported that the search does not work. Does the search look at all the phone fields? does it matter what format type is in the Contacts? eg: 1.800.123.4567, 1-800-123-4567, 1(800)123-4567
08-22-2008 08:57 AM
Yes, the format of the phone number does have to match. Meaning if a user has a number entered liked (800) 555-1234 and you search for 800-555-1234 you won't get a match.
Instead, you could search for a substring of the phone number (such as the last 4 digits) and then parse the digits from the contacts that are returned to see if it matches the digits you are looking for (compare after removing all non numeric characters).