Results 1 to 4 of 4

Thread: Campaign field to search popup doesn't work?

  1. #1
    chiefnt is offline Member
    Join Date
    Jun 2008
    Posts
    9

    Default Campaign field to search popup doesn't work?

    I have added the Campaign field to the Lead search popup but it doesn't filter at all (no result show up). I have added the Campaign field to both the basic and advance Lead search and both filter correctly. I have also added the Campaign field to the Contact search popup using similar code found below.

    Why does my Campaign filter not work for Leads? I'm running 5.2.0f.




    PHP Code:
                            'whereClauses' => 
                                array(
    'first_name' => 'leads.first_name'
                                        
    'last_name' => 'leads.last_name',
                                        
    'lead_source' => 'leads.lead_source',
                                                                            
    'campaign_name' => 'campaigns.name',
                                                                            
    'campaign_id' => 'campaigns.id',
                                                                            
    'status' => 'leads.status'),
                        

                                    
                            
    'searchInputs' =>
                                array(
    'first_name''last_name''lead_source''campaign_name''status'),
                            
                            
    'searchdefs'   => array(
                                                 
    'first_name',
                                                 
    'last_name'
                                                
    'lead_source'
                                                
    'status',
                                                                                            array(
    'name' => 'campaign_name''displayParams' => array('hideButtons'=>'true''size'=>30'class'=>'sqsEnabled sqsNoAutofill')),
                                                array(
    'name' => 'assigned_user_id''type' => 'enum''label' => 'LBL_ASSIGNED_TO''function' => array('name' => 'get_user_array''params' => array(false))), 
    Last edited by chiefnt; 2009-06-19 at 03:59 AM.

  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: Campaign field to search popup doesn't work?

    It happens probably because the campaign field on Leads has no all required information to let Sugar retrieve data from its properly.
    To make sure that do the following:
    Edit the file include/ListView/ListViewData.php and add this line:

    PHP Code:
    echo "<LI>$main_query</LI>"
    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']; 
    Try to search for some campaign on Popup.
    Let us know the query.

    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
    chiefnt is offline Member
    Join Date
    Jun 2008
    Posts
    9

    Default Re: Campaign field to search popup doesn't work?

    Thanks for the reply, Andre. Unfortunately, it didn't solve the problem.

    I inserted the code as such, in the include/ListView/ListViewData.php file:
    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'];  
                   echo 
    "<LI>$main_query</LI>"
    Now when I use the Lead select button to open the search popup the following text is displayed in the popup window:
    [I] SELECT leads.id ,leads_cstm.current_title_c,leads_cstm.resume_c,le ads_cstm.quick_notes_c,leads_cstm.lead_type_c,lead s_cstm.req_code_c,leads_cstm.current_employer_c,le ads_cstm.screen_notes_c,leads_cstm.education_c,lea ds_cstm.salary_expectations_c,leads_cstm.position_ c, CONCAT(IFNULL(leads.first_name,''),' ',IFNULL(leads.last_name,'')) as name, leads.first_name , leads.last_name , leads.salutation , leads.lead_source , leads.status , jt0.user_name assigned_user_name , jt0.created_by assigned_user_name_owner , 'Users' assigned_user_name_mod, leads.assigned_user_id ,leads.account_name FROM leads LEFT JOIN leads_cstm ON leads.id = leads_cstm.id_c LEFT JOIN users jt0 ON jt0.id= leads.assigned_user_id AND jt0.deleted=0 AND jt0.deleted=0 where (campaigns.name like 'Test Web to Lead for full Resume%') AND leads.deleted=0 ORDER BY name ASC[/
    I]

    And when searching for a Campaign, there are still no results.

    NOTE: the page for Lead- Advanced Search also shows the above text on that page. Filtering for a Campaign in the Lead Advance search displays the correct results.

    Any other suggestions?

    Thanks!

  4. #4
    maloner's Avatar
    maloner is offline Sugar Community Member
    Join Date
    Mar 2007
    Location
    Westmeath & Dublin
    Posts
    95

    Default Re: Campaign field to search popup doesn't work?

    Hi There,

    Did you ever get a resolution on this?

    Regards,

    James
    John Malone
    Provident CRM Ltd
    SugarCRM Implementation Partner - Ireland
    http://www.providentcrm.ie/sugar-crm.html
    email: john@providentcrm.ie
    ph: 01-4403685

    Checkout our Monthly meetup: http://lampsoftware.meetup.com/9/
    SugarCRM Ireland Linked-In Group: http://www.linkedin.com/groups?gid=884327
    SugarCRM UK Linked-In Group: http://www.linkedin.com/groups?gid=1813385

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. popup search does not work after server move
    By dogfuel in forum Developer Help
    Replies: 15
    Last Post: 2010-10-30, 12:33 AM
  2. Replies: 3
    Last Post: 2009-05-21, 10:29 AM
  3. Replies: 0
    Last Post: 2008-09-10, 07:25 PM
  4. popup search - add field from linked module
    By mikesolomon in forum Developer Help
    Replies: 0
    Last Post: 2008-09-04, 10:45 AM
  5. custom search field doesn't work
    By jojiju in forum Developer Help
    Replies: 3
    Last Post: 2008-05-01, 04:15 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
  •