Results 1 to 7 of 7

Thread: SQL error on Leads

  1. #1
    al3
    al3 is offline Sugar Community Member
    Join Date
    Aug 2007
    Posts
    394

    Default SQL error on Leads

    Error retrieving Lead list: Query Failed:SELECT leads.*, users.user_name assigned_user_name FROM leads LEFT JOIN users ON leads.assigned_user_id=users.id where (leads.status in ('In Process')) AND leads.deleted=0 ORDER BY name ASC LIMIT 3,1::MySQL error 1054: Unknown column 'name' in 'order clause'

    If Leads are sorted on Contact I get the above when I click on one of them.

    If sorted by Account, it is OK.

    I looked all over on where to file a bug, but didn't fine it.

    Thanks,

    Al
    Sugar 4.5.1e, FreeBSD 6.2, MySQL 5.x, PHP 5.x, Apache 2.x

  2. #2
    sacramentojoe is offline Sugar Community Member
    Join Date
    Nov 2005
    Posts
    447

    Default Re: SQL error on Leads

    If you have access to the files, you can change this on the ListView.html file.

    Change the top part where the name is to leads.last_name

    , this should fix it

  3. #3
    al3
    al3 is offline Sugar Community Member
    Join Date
    Aug 2007
    Posts
    394

    Default Re: SQL error on Leads

    Quote Originally Posted by sacramentojoe
    If you have access to the files, you can change this on the ListView.html file.

    Change the top part where the name is to leads.last_name

    , this should fix it
    Sorry, I just don't see the line in file to change. Can you give an example?

    Thanks,
    Al

  4. #4
    sacramentojoe is offline Sugar Community Member
    Join Date
    Nov 2005
    Posts
    447

    Default Re: SQL error on Leads

    ListView.html

    <td scope="col" width="15%" class="listViewThS1"><slot><a href="{ORDER_BY}last_name" class="listViewThLinkS1">{MOD.LBL_LIST_NAME}{arrow _start}{last_name_arrow}{arrow_end}</span></a></slot></td>


    See where it says <a href="{ORDER_BY}last_name

  5. #5
    al3
    al3 is offline Sugar Community Member
    Join Date
    Aug 2007
    Posts
    394

    Default Re: SQL error on Leads

    Quote Originally Posted by sacramentojoe
    ListView.html

    <td scope="col" width="15%" class="listViewThS1"><slot><a href="{ORDER_BY}last_name" class="listViewThLinkS1">{MOD.LBL_LIST_NAME}{arrow _start}{last_name_arrow}{arrow_end}</span></a></slot></td>


    See where it says <a href="{ORDER_BY}last_name
    Here is what I put in /modules/leads/listview.html:
    <!-- END: list_nav_row -->
    <tr height="20">
    <td scope="col" class="listViewThS1" NOWRAP>{CHECKALL}</td>
    <td scope="col" width="20%" class="listViewThS1"><slot><a href="{ORDER_BY}leads.last_name" class="listViewThLinkS1">{MOD.LBL_LIST_NAME}{arrow _start}{last_name_arrow}{

    -------
    I still get:
    Error retrieving Lead list: Query Failed:SELECT leads.*, users.user_name assigned_user_name FROM leads LEFT JOIN users ON leads.assigned_user_id=users.id where leads.deleted=0 ORDER BY name ASC LIMIT 4,1::MySQL error 1054: Unknown column 'name' in 'order clause'

    Must be in a different module?

    Al

  6. #6
    Angel's Avatar
    Angel is offline Sugar Community Member
    Join Date
    Jul 2005
    Location
    Los Angeles
    Posts
    4,813

    Default Re: SQL error on Leads

    This is a bug in Sugar. See this thread for a fix:
    http://www.sugarcrm.com/forums/showthread.php?t=23908
    Regards,

    Angel Magaña
    Co-Author: Implementing SugarCRM 5.x (Packt Publishing -- Sept. 2010)
    Blog: http://cheleguanaco.blogspot.com.
    Twitter: @cheleguanaco.

    ________
    | Projects: |_____________________________________
    |
    | CandyWrapper (.NET Wrapper for SugarCRM SOAP API). Source now available on GitHub!
    | GoldMine to SugarCRM Express Conversion. Latest: 1.0.1.7 (Nov. 3, 2009)
    | CRM SkyDialer (Skype Integration). Latest: 1.0.2 (Feb. 17, 2010)
    | Round Robin Leads Assignment
    | Phone Number Formatter
    | CaseTwit (Twitter Integration)
    ______________________________________________

  7. #7
    al3
    al3 is offline Sugar Community Member
    Join Date
    Aug 2007
    Posts
    394

    Default Re: SQL error on Leads

    Quote Originally Posted by Angel
    This is a bug in Sugar. See this thread for a fix:
    http://www.sugarcrm.com/forums/showthread.php?t=23908
    Thanks. Worked great.

    Al

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 2008-02-22, 04:25 PM
  2. SQL Error 1054 in Leads w/4.5.1e
    By les@glsi in forum Installation and Upgrade Help
    Replies: 2
    Last Post: 2007-08-12, 01:23 PM
  3. I can see leads that are not assigned to me
    By keak in forum Developer Help
    Replies: 6
    Last Post: 2007-02-05, 05:33 PM
  4. Replies: 1
    Last Post: 2006-07-07, 11:50 AM

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
  •