Results 1 to 4 of 4

Thread: contact page displays fewer records than are in the database

  1. #1
    cerhorn is offline Sugar Community Member
    Join Date
    Aug 2007
    Posts
    34

    Default contact page displays fewer records than are in the database

    I'm converting data from Sugar to another CRM package, and noticed that a simple SQL query that joins the contact table to the user table by assigned user id returns more records than the contact page search facility. I am eliminating deleted records in my SQL statement, so that is not the problem.

    We're using the Sugar appliance 4.51e, on a VM Ware box.

    Any ideas?

  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: contact page displays fewer records than are in the database

    Hi cerhorn

    By default SugarCRM use LEFT JOIN to get the assigned user name, so it display contacts even if they have no assigned_user. If you are using a INNER JOIN then you will get only the contacts containing assigned user name.
    Let me know the query you are using.

    Best regards
    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
    cerhorn is offline Sugar Community Member
    Join Date
    Aug 2007
    Posts
    34

    Default Re: contact page displays fewer records than are in the database

    The problem is that I only want records assigned to a particular user, so an inner join is fine. However when I use the advanced search on the contacts page to search by user, I get less records than the inner join query.

    Doing some more research, I exported the entire contact table to Excel using the export function in Sugar. Then I counted how many rows for one user and compared to the result of the advanced search by user. The advanced search missed records that are assigned to this user. The differences seem to be contacts with no parent account.

  4. #4
    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: contact page displays fewer records than are in the database

    Hi cerhorn

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

    PHP Code:
    echo "<LI>$main_query"
    Just bellow 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']; 
    Analyze the returned query. You will identify the reason for fewer records.

    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.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. HELP - Act import (field mapping)
    By smelamed in forum Help
    Replies: 32
    Last Post: 2010-12-15, 05:39 PM
  2. Adding a category for Contact database
    By hemanr in forum Help
    Replies: 0
    Last Post: 2005-11-18, 11:16 AM
  3. Replies: 5
    Last Post: 2005-08-15, 09:57 AM
  4. Replies: 12
    Last Post: 2004-11-02, 01:42 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
  •