Results 1 to 3 of 3

Thread: Search by Account Name fails for accounts with parent accounts in 5.0.0d

  1. #1
    pkranz is offline Sugar Community Member
    Join Date
    Jun 2006
    Posts
    13

    Default Search by Account Name fails for accounts with parent accounts in 5.0.0d

    If I attempt to search by Account Name, Accounts who are associated with a parent account will not be found based on the way the SQL is generated:

    Here is the SQL 5.0.0d generates for a Account Name Search; this returns 0 results (although it should return a hit)

    SELECT accounts.id ,
    accounts_cstm.*,
    accounts.name ,
    jt0.name parent_name ,
    jt0.assigned_user_id parent_name_owner ,
    'Accounts' parent_name_mod,
    accounts.parent_id ,
    accounts.shipping_address_street ,
    accounts.assigned_user_id
    FROM accounts
    LEFT JOIN accounts_cstm ON accounts.id = accounts_cstm.id_c
    LEFT JOIN accounts jt0 ON jt0.id= accounts.parent_id
    AND jt0.deleted=0
    AND jt0.deleted=0
    where ((jt0.name like '%ennis%'))
    AND accounts.deleted=0
    ORDER BY accounts.name ASC LIMIT 0,21

    If I make the following change the query I get the expected results:

    SELECT accounts.id ,
    accounts_cstm.*,
    accounts.name ,
    jt0.name parent_name ,
    jt0.assigned_user_id parent_name_owner ,
    'Accounts' parent_name_mod,
    accounts.parent_id ,
    accounts.shipping_address_street ,
    accounts.assigned_user_id
    FROM accounts
    LEFT JOIN accounts_cstm ON accounts.id = accounts_cstm.id_c
    LEFT JOIN accounts jt0 ON jt0.id= accounts.parent_id
    AND jt0.deleted=0
    AND jt0.deleted=0
    where ((accounts.name like '%ennis%'))
    AND accounts.deleted=0
    ORDER BY accounts.name ASC LIMIT 0,21

    So the remaining question is, why is sugar attempting to match on the Parent record name instead of the child record name? This architecture means that any child account names will never show up in searches, only parent records will show up in searches..

  2. #2
    pkranz is offline Sugar Community Member
    Join Date
    Jun 2006
    Posts
    13

    Default Re: Search by Account Name fails for accounts with parent accounts in 5.0.0d

    Problem fixed in 5.0.0e

  3. #3
    pkranz is offline Sugar Community Member
    Join Date
    Jun 2006
    Posts
    13

    Default Re: Search by Account Name fails for accounts with parent accounts in 5.0.0d

    Broken again in 5.0.0f and 5.1 RC

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Bug: customizations affect Account search
    By piccirm2 in forum Help
    Replies: 0
    Last Post: 2008-05-09, 03:38 PM
  2. Replies: 1
    Last Post: 2008-03-31, 03:51 PM
  3. Replies: 1
    Last Post: 2006-09-11, 03:38 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
  •