Results 1 to 8 of 8

Thread: Project search by assigned user fails - Unknown column 'u.assigned_user_name'

  1. #1
    tolat is offline Member
    Join Date
    Feb 2009
    Posts
    10

    Default Project search by assigned user fails - Unknown column 'u.assigned_user_name'

    Using Sugar CE 5.2.0c, we get the following when we search Projects by assigned user:

    Query: SELECT project.id ,project_cstm.project_id_c,project_cstm.account_id _c,project_cstm.proj_type_c,project_cstm.proj_regi on_c, project.name , project.status , project.date_modified , jt0.user_name assigned_user_name , jt0.created_by assigned_user_name_owner , 'Users' assigned_user_name_mod, jt1.name primary_acct_c , project.assigned_user_id FROM project LEFT JOIN project_cstm ON project.id = project_cstm.id_c LEFT JOIN users jt0 ON
    jt0.id= project.assigned_user_id AND jt0.deleted=0
    AND jt0.deleted=0 LEFT JOIN accounts jt1 ON project_cstm.account_id_c = jt1.id AND jt1.deleted=0 where ((u.assigned_user_name like 'nitins%')) AND project.deleted=0 ORDER BY project.name ASC LIMIT 0,21
    Sun Mar 22 21:47:33 2009 [16130][34e09b69-e0b2-d73e-b2d3-498845d59c6c][INFO] Query Execution Time:0.00054621696472168


    Sun Mar 22 21:47:33 2009 [16130][34e09b69-e0b2-d73e-b2d3-498845d59c6c][ERROR] MySQL error 1054: Unknown column 'u.assigned_user_name' in 'where clause'


    Is this a bug in Sugar or a bad deployment of the Accounts module? Any ideas how this might be fixed?

    Thanks.

  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: Project search by assigned user fails - Unknown column 'u.assigned_user_name'

    Hi tolat

    It seems you had create custom fields for the Project module.
    Attach in your next message the file cache/modules/Project/Projectvardefs.php.

    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
    tolat is offline Member
    Join Date
    Feb 2009
    Posts
    10

    Default Re: Project search by assigned user fails - Unknown column 'u.assigned_user_name'

    Thanks for your help. I've attached the Projectvardefs.php as requested.
    Attached Files Attached Files

  4. #4
    tolat is offline Member
    Join Date
    Feb 2009
    Posts
    10

    Default Re: Project search by assigned user fails - Unknown column 'u.assigned_user_name'

    One other related question is that I would like to search on assigned_user_id but it doesn't show up in the list of fields in Studio that I search on. I only see assigned_user_name.

    Thanks

  5. #5
    tmamayek is offline Sugar Community Member
    Join Date
    Apr 2008
    Location
    Hartford, WI
    Posts
    52

    Default Re: Project search by assigned user fails - Unknown column 'u.assigned_user_name'

    I'm having the same issue. I have it fixed in Accounts, but I need to be able to search by "assigned user ID" in the Leads as well as Accounts. In accounts the only option I get is "Assigned user name," but that doesn't seem to work. How can we get that fixed so I ca select assigned user ID in leads. When i click on fields in the studio for leads, I see both options, however under the search categories, I just see "assigned user name"

  6. #6
    tolat is offline Member
    Join Date
    Feb 2009
    Posts
    10

    Default Re: Project search by assigned user fails - Unknown column 'u.assigned_user_name'

    I actually was able to hack this in by editing searchdefs.php in custom/modules/Project/metadata and added:

    'assigned_user_id' =>
    array (
    'name' => 'assigned_user_id',
    'type' => 'enum',
    'label' => 'LBL_ASSIGNED_USER_ID',
    'function' =>
    array (
    'name' => 'get_user_array',
    'params' =>
    array (
    0 => false,
    ),
    ),
    'default' => true,
    'width' => '10%',
    ),


    I edited the file and then rebuilt the search view in Studio by just changing one field and then Save/Deploy.

    I don't know if I followed any wrong protocol in doing this but it worked.

    Hope this works for you.

  7. #7
    leemoney24 is offline Sugar Community Member
    Join Date
    Feb 2006
    Posts
    56

    Default Re: Project search by assigned user fails - Unknown column 'u.assigned_user_name'

    This worked for me! Thanks for posting!

    Observation:
    The non-working field type was a single select field (auto-searches database).
    The working field type is a multi-select.
    Working now!

  8. #8
    tmamayek is offline Sugar Community Member
    Join Date
    Apr 2008
    Location
    Hartford, WI
    Posts
    52

    Default Re: Project search by assigned user fails - Unknown column 'u.assigned_user_name'

    Tolat,

    I don't see the searchdefs.php in custom/modules/Project/metadaat. I do however see it in custom/modules/Accounts/metadata. Is this correct, or should I see the file under projects? I'm confused since I never got the error in the projects module, just in the accounts module is where I'm looking to see this field added.

    Please let me know when you get a chance. I really appreciate your help.

    -Ted

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. show user details: mysql error 1054, unknown column name
    By wivaku in forum General Discussion
    Replies: 9
    Last Post: 2007-11-16, 05:30 PM
  2. invalid column assigned_user_name
    By eggsurplus in forum Help
    Replies: 1
    Last Post: 2007-10-12, 06:21 PM
  3. MySQL error 1054: Unknown column 'user' HELP!
    By tj@estreet.com in forum Help
    Replies: 2
    Last Post: 2007-06-27, 05:44 AM
  4. Search/Update for Assigned User
    By andreasw in forum Help
    Replies: 0
    Last Post: 2006-02-27, 06:06 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
  •