4 Replies Latest reply on May 6, 2014 3:37 AM by sedona_1

    Problem with Scripted Find

    sedona_1

      Title

      Problem with Scripted Find

      Post

           I have a series of buttons on a layout labeled A through Z. Each button has a script parameter - the A button has a parameter of "A", the B button a parameter of "B", and so on. They all run a simple script that performs a find for any contacts that have a name beginning with that letter.

           The script works well except for one thing that's driving me crazy! When I click one of the buttons, it returns contacts with any word in their name that begins with that letter. For example, if I click the A button, it returns things like Adams, John and ABC Corp, which is fine. But I also get things like XYZ Association, which isn't what I want.

           Is there a way to force the find to only return contacts in which the first word of their name begins with the letter?

           I've been thinking that the problem isn't with the script, but with the parameter on the buttons. In fact, I tried using this calculation as the parameter:  Left ( nameContact ;  Position ( nameContact ;  "A" ;  1 ;  1 ) ). That didn't work, and now I'm drawing a blank, so any help at all will be appreciated!

           Thanks so much!