Issue:
When attempting to search for a customer using a billing contact’s phone number, the search does not return the expected results.
Resolution:
The telephone number search does not search for all contacts.
The query is looking at the Phone 1 and Phone 2 fields in the primary Bill To record.
It also looks at the phone numbers on the site records.
Below is a section of the query that is used for the search and it only looks at the primary billing and site records where the customer in not inactive.
WHERE (cust.Customer_Name <> 'N/A' AND cbill.Is_Primary = 'Y')
AND (cbill.Phone_1 LIKE '6127101390%' OR cbill.Phone_2
LIKE '6127101390%'
OR sSite.Phone_1 LIKE '6127101390%'
OR sSite.Phone_2 LIKE '6127101390%' )
AND (cstat.Customer_Status_Id != 3) AND (cust.Customer_Id > 0)