Results 1 to 5 of 5

Thread: Add custom field to popup search for target list

  1. #1
    Gilneas is offline Sugar Community Member
    Join Date
    Apr 2010
    Posts
    53

    Question Add custom field to popup search for target list

    Hi guys,

    I'm using sugarCE v6.2.0 and I'm wondering why module TargetLists is not available in Studio. However, I'm searching for a solution for the following problem.

    In module Contacts we have a custom dropdown called Type, so we can categorize accounts e.g. as partners.

    Now we want to create a TargetList containing all contacts being of Type "partner". So we created a new target list and would like to select from popup search all contact being of type partner.


    How can I add this custom field contacts_cstm.type to popup search in target lists?
    Is there an upgrade save way to do that? Or if not a hack?

  2. #2
    rafael.q.g@hotmail.com's Avatar
    rafael.q.g@hotmail.com is offline Sugar Community Member
    Join Date
    Jun 2011
    Location
    Florianópolis - Brazil
    Posts
    782

    Default Re: Add custom field to popup search for target list

    The search fields available on popup are defined into your searchdefs.
    In your case you have to edit the file modules/ProspectLists/metadata/searchdefs.php, and add the desired fields.
    Rafael Queiroz Gonçalves
    Advanced OMG UML Certified Professional
    Sun Certified Enterprise Architect for the Java Platform
    Sun Certified Programmer for the Java 2 Platform
    IBM Certified Advanced Application Developer - Lotus Notes and Domino
    IBM Certified Application Developer - IBM WebSphere Portlet Factory
    Computer Science Mastering / UFSC - PPGCC

  3. #3
    Gilneas is offline Sugar Community Member
    Join Date
    Apr 2010
    Posts
    53

    Default Re: Add custom field to popup search for target list

    Thanks for your fast reply.

    Okay, what I got there is the following:

    PHP Code:
      $searchdefs['ProspectLists'] = array(
                        
    'templateMeta' => array(
                                
    'maxColumns' => '3',
                                
    'maxColumnsBasic' => '4',  
                                
    'widths' => array('label' => '10''field' => '30'),                 
                               ),
                        
    'layout' => array(                      
                            
    'basic_search' => array(
                                array(
    'name'=>'name''label'=>'LBL_PROSPECT_LIST_NAME',),
                                 array(
    'name'=>'current_user_only''label'=>'LBL_CURRENT_USER_FILTER''type'=>'bool'),
                                 
                            ),
                            
    'advanced_search' => array(
                                array(
    'name'=>'name''label'=>'LBL_PROSPECT_LIST_NAME',),
                                 array(
    'name'=>'list_type''label'=>'LBL_LIST_TYPE''type'=>'enum'),
                                 array(
    'name'=>'current_user_only''label'=>'LBL_CURRENT_USER_FILTER''type'=>'bool'),
                                 
                            ),
                        ),
                    ); 
    And I'm sorry, but I do not understand how to add my custom field here. None of these fields listed in here do appear in the popup search.

    I added the followinh code to the file, am I completely wrong?

    My field is a custom dropdown in contacts module named 'type_c' .

    PHP Code:
      $searchdefs['contacts'] = array(
                        
    'templateMeta' => array(
                                
    'maxColumns' => '3',
                                
    'maxColumnsBasic' => '4',  
                                
    'widths' => array('label' => '10''field' => '30'),                 
                               ),
                        
    'layout' => array(                      
                            
    'basic_search' => array(
                                array(
    'name'=>'type_c''label'=>'LBL_TYPE''type'=> 'DropDown'),
                            ),
                            
    'advanced_search' => array(
                                array(
    'name'=>'type_c''label'=>'LBL_TYPE''type'=> 'DropDown'),
                            ),
                        ),
                    ); 
    And in addition, is this an ugrade safe way, or can I make it upgrade safe by copying this file to the custom dir?

  4. #4
    robertbmirth is offline Sugar Community Member
    Join Date
    Jun 2010
    Location
    Irvine, CA
    Posts
    345

    Default Re: Add custom field to popup search for target list

    If you're pulling up a search for contacts, then you don't need to modify the targetlist pop up, you need to modify the contact pop up. So you can go to studio -> contacts -> layouts -> popup etc. You don't need to touch your viewdefs in this case.
    Robert Beckman
    Software Engineer
    Mirth Corporation

  5. #5
    Gilneas is offline Sugar Community Member
    Join Date
    Apr 2010
    Posts
    53

    Lightbulb Re: Add custom field to popup search for target list

    @ robertbmirth:
    That did it. Thanks!

    Cool, that it's that easy...

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Use custom field to search contact in target list
    By D A G in forum Developer Help
    Replies: 8
    Last Post: 2010-10-28, 07:26 PM
  2. use custom field account to search contact in target list
    By Beranrdi in forum Developer Help
    Replies: 9
    Last Post: 2010-07-30, 04:12 AM
  3. Replies: 4
    Last Post: 2009-05-21, 09:12 AM
  4. Target list popup contact search
    By arasdeveloper2 in forum Help
    Replies: 0
    Last Post: 2009-02-04, 10:01 AM
  5. Replies: 0
    Last Post: 2008-04-16, 06:27 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
  •