7 Replies Latest reply on Nov 13, 2014 12:36 PM by Mike_Mitchell

    Searching telephone numbers

    aric

      The phone rings and I quickly search for the last four digits of the number in my contacts database and no record is found. If I enter in my phone numbers as 555-5555 and I search for 5555 no record is found.

       

      How can I solve this issue other than recording phone numbers as 123 456 7890?

       

      Sorry for the basic question. Thank you for your help.

        • 1. Re: Searching telephone numbers
          Mike_Mitchell

          Enter *5555 as your search string.

          • 2. Re: Searching telephone numbers
            aric

            Thank you.

             

            That works when performing a find for a specific field, but it does not seem to work when using the search field at the top of the window.  I would like to be able to search all fields for the information.  They could be calling from work or their cell or direct line.

             

            Thank you.

            • 3. Re: Searching telephone numbers
              Mike_Mitchell

              You have a few different options:

               

              1) Create another field called “LastFour” (or whatever) that’s a calculation or text field with auto-enter calculated value equal to the last 4 digits of the phone number in question. You can use a single field by utilizing the List ( ) function to include all the numbers you want to include and the Quick Find should still find it okay. Downside: You’re adding another field to your schema, which is bad practice.

               

              2) Create your own Quick Find feature by using a global field and interposing the “*” character in front of the search string before you perform the Find (using the Perform Quick Find script step). You can then configure it however you want. You can use a button to trigger it, or, get a little fancier and use an OnObjectKeystroke trigger to look for a carriage return or “Enter” (Code ( 13 ) or Code ( 10 )) to trigger the script to run.

               

              3) Reconfigure your database so all phone numbers are in their own table, related to the contacts table, rather than in separate fields. Then just perform the *XXXX search in a single field. (This is probably preferable in the long run from a data modeling standpoint.)

               

              HTH

               

              Mike

              • 4. Re: Searching telephone numbers
                aric

                Thank you so much for the info.  REally grateful.  Will get to work on this.

                 

                Thanks Mike.

                 

                Aric

                • 5. Re: Searching telephone numbers

                  Hi aric,

                   

                  What we've done is make a Calc like this for the field that we are searching on:

                   

                  Right ( GetAsText ( GetAsNumber (PhoneNo) ) ; 7)

                   

                  It will invariably take most international phone numbers into a readily searchable string so long as you make sure that extensions are never entered or, if they are, they are first stripped off before applying the Calc.

                   

                  We've appended cell, work and home phone numbers as a return separated list, and also applied the calc to the number used for the search string making it a scripted Find. That won't work for the Quick Find so you'd have to make sure you always entered the string of 7 digits there.

                   

                  Maybe this will help somwhat,

                   

                  John

                  • 6. Re: Searching telephone numbers
                    ErikWegweiser

                    Possibly a related question: I've never (at least in recent versions of FM) been able to search in text fields for the dash "-" character.

                    No combitnation of asterisk or quotes seems to allow me to do so. Not particularly in phone number fiels. More likely in name

                    fields, for instance, if I want to search for any hyphenated last names.

                     

                    Is there a proper search operator(s) to accomplish this without the addition of calculations or scripting?

                     

                    Thanks.

                    • 7. Re: Searching telephone numbers
                      Mike_Mitchell

                      Erik -

                       

                      I just tried this string:

                       

                      ”-“

                       

                      and it appears to work.