Results 1 to 5 of 5

Thread: Account search does not work

  1. #1
    Sukale is offline Sugar Community Member
    Join Date
    Mar 2008
    Posts
    12

    Default Account search does not work

    Dear all,

    we have updated our Sugar CRM to Version 5.1.0b But still the search function in Accounts does not work.

    I have modified the layout in the studio. The Basic search function does not show any records if I search for accounts assigned to one special employee. If I use a combination in Advanced search (e.g. Name + Assigned to + Industry) sometimes it shows some records, sometimes it does not although there is such an account.

    Does anybody have the same problem and how did you fix it?

    Thanks for any support in advance

    Regards

    Lars

  2. #2
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: Account search does not work

    Hi Lars

    Edit the file include/ListView/ListViewData.php and add the code:

    PHP Code:
    echo "<LI>$main_query"
    Just after the line:
    PHP Code:
    $main_query $ret_array['select'] . $params['custom_select'] . $ret_array['from'] . $params['custom_from'] . $ret_array['where'] . $params['custom_where'] . $ret_array['order_by'] . $params['custom_order_by']; 
    Save the file and go to Accounts ListView again.
    A sql query will be displayed in the screen. Copy it and paste into phpMyAdmin. Run it.
    phpMyAdmin should warn a error message.
    Let us know both query and error.

    Cheers
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

  3. #3
    Sukale is offline Sugar Community Member
    Join Date
    Mar 2008
    Posts
    12

    Default Re: Account search does not work

    Hello André,

    thank you for your fast reply.

    Here is the query:

    SELECT accounts.id , accounts.name , accounts.industry , accounts.rating , accounts.billing_address_city , accounts.billing_address_postalcode , accounts.annual_revenue , accounts.employees , jt0.user_name assigned_user_name , jt0.created_by assigned_user_name_owner , 'Users'
    assigned_user_name_mod, accounts.assigned_user_id , accounts.created_by FROM accounts LEFT JOIN users jt0 ON jt0.id= accounts.assigned_user_id AND jt0.deleted=0 AND jt0.deleted=0 where ((accounts.assigned_user_name like 'Username%')) AND accounts.deleted=0 ORDER BY accounts.name ASC

    and here we are with the error message:

    Unknown column 'accounts.assigned_user_name' in 'where clause'

    Thank you for your help

    Regards

    Lars

  4. #4
    mikesolomon is offline Sugar Community Member
    Join Date
    Feb 2008
    Location
    UK
    Posts
    1,467

    Default Re: Account search does not work

    Quote Originally Posted by Sukale
    Hello André,

    thank you for your fast reply.

    Here is the query:

    SELECT accounts.id , accounts.name , accounts.industry , accounts.rating , accounts.billing_address_city , accounts.billing_address_postalcode , accounts.annual_revenue , accounts.employees , jt0.user_name assigned_user_name , jt0.created_by assigned_user_name_owner , 'Users'
    assigned_user_name_mod, accounts.assigned_user_id , accounts.created_by FROM accounts LEFT JOIN users jt0 ON jt0.id= accounts.assigned_user_id AND jt0.deleted=0 AND jt0.deleted=0 where ((accounts.assigned_user_name like 'Username%')) AND accounts.deleted=0 ORDER BY accounts.name ASC

    and here we are with the error message:

    Unknown column 'accounts.assigned_user_name' in 'where clause'

    Thank you for your help

    Regards

    Lars
    I had this problem

    I solved it by editing custom/modules/Accounts/metadata/searchdefs

    replace the assigned_user_name bit with

    Code:
     'assigned_user_id' => 
          array (
            'name' => 'assigned_user_id',
            'type' => 'enum',
            'label' => 'LBL_ASSIGNED_TO',
            'function' => 
            array (
              'name' => 'get_user_array',
              'params' => 
              array (
                0 => false,
              ),
            ),
            'default' => true,
            'sortable' => false,
          ),
    Mike Solomon
    Development Manager
    Ivy Ltd
    www.ivy.ltd.uk]www.ivy.ltd.uk

    php version 5.2.6
    MySql 5.1.59

  5. #5
    Sukale is offline Sugar Community Member
    Join Date
    Mar 2008
    Posts
    12

    Default Re: Account search does not work

    Hello Mike,

    thank you for your support. Unfortunately we were not able to fix the problem. We still get the same error message.

    Any further suggestions?

    Regards

    Lars

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Account name search broken
    By bennybtl in forum Help
    Replies: 4
    Last Post: 2008-05-13, 08:53 PM
  2. Account search by phone
    By dennison in forum Help
    Replies: 1
    Last Post: 2007-09-12, 10:04 AM
  3. Search Contacts By Account Type
    By leighj in forum Help
    Replies: 2
    Last Post: 2007-09-05, 12:51 PM
  4. How to Edit the Panel under Account Search Form
    By vinhtran in forum General Discussion
    Replies: 0
    Last Post: 2005-09-16, 04:16 AM
  5. Replies: 0
    Last Post: 2004-11-03, 02:17 PM

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
  •