Results 1 to 2 of 2

Thread: Case Search not working like it used to.

  1. #1
    Uzaree is offline Sugar Community Member
    Join Date
    Jun 2006
    Posts
    10

    Default Case Search not working like it used to.

    In the older version, I think 4.1, I could type in part of the string to search for and it would find it. Now I have to have the full string to search by. Could someone tell me where to go and what to add so I can search the complete string of the subject for part of the text.

  2. #2
    wjohnson is offline Sugar Community Member
    Join Date
    Dec 2005
    Posts
    242

    Default Re: Case Search not working like it used to.

    There was a bug with that. This is what they told me to do:


    To use wild cards to get more search results, go to ./soap/SoapSugarUsers.php in the function "search_by_module" you'll find a variable called $query_array that looks like this:

    $query_array = array('Accounts'=>array('where'=>"accounts.name like '{0}%'",'fields'=>"accounts.id id, accounts.name"),
    'Bugs'=>array('where'=>"bugs.name like '{0}%'",'fields'=>"bugs.id, bugs.name, bugs.bug_number"),
    'Cases'=>array('where'=>"cases.name like '{0}%'",'fields'=>"cases.id, cases.name, cases.case_number"),
    'Contacts'=>array('where'=>"contacts.first_name like '{0}%' OR contacts.last_name like '{0}%' OR contacts.email1 like '{0}%' OR contacts.email2 like '{0}%'",'fields'=>"contacts.id, contacts.first_name, contacts.last_name, contacts.email1"),
    'Leads'=>array('where'=>"leads.first_name like '{0}%' OR leads.last_name like '{0}%' OR leads.email1 like '{0}%' OR leads.email2 like '{0}%'", 'fields'=>"leads.id, leads.first_name, leads.last_name, leads.email1"),
    'Opportunities'=>array('where'=>"opportunities.nam e like '{0}%'", 'fields'=>"opportunities.id, opportunities.name"));


    You can change it to this:

    $query_array = array('Accounts'=>array('where'=>"accounts.name like '%{0}%'",'fields'=>"accounts.id id, accounts.name"),
    'Bugs'=>array('where'=>"bugs.name like '%{0}%'",'fields'=>"bugs.id, bugs.name, bugs.bug_number"),
    'Cases'=>array('where'=>"cases.name like '%{0}%'",'fields'=>"cases.id, cases.name, cases.case_number"),
    'Contacts'=>array('where'=>"contacts.first_name like '%{0}%' OR contacts.last_name like '%{0}%' OR contacts.email1 like '%{0}%' OR contacts.email2 like '%{0}%'",'fields'=>"contacts.id, contacts.first_name, contacts.last_name, contacts.email1"),
    'Leads'=>array('where'=>"leads.first_name like '%{0}%' OR leads.last_name like '%{0}%' OR leads.email1 like '%{0}%' OR leads.email2 like '%{0}%'", 'fields'=>"leads.id, leads.first_name, leads.last_name, leads.email1"),
    'Opportunities'=>array('where'=>"opportunities.nam e like '%{0}%'", 'fields'=>"opportunities.id, opportunities.name"));

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •