Results 1 to 4 of 4

Thread: Searching many fields with one field

  1. #1
    aprameya is offline Member
    Join Date
    Jun 2009
    Posts
    8

    Default Searching many fields with one field

    Hi,

    I have 5 instances of same drop down list. Like

    HTML Code:
    Working Field 1 : 
                  Medicine
                  Architect
                  Engineer
                  Sales
                  Other
    
    Working Field 2 : 
                  Medicine
                  Architect
                  Engineer
                  Sales
                  Other
    
    ...
    
    Working Field 5 : 
                  Medicine
                  Architect
                  Engineer
                  Sales
                  Other
    Now, I want to search for a person, who is an Engineer.... Problem is that i have to add all 5 Drop downs to the search layout and everytime look for 'engineer' in all 5 dropdowns to get the record....

    Is there a way where we can have just one dropdown field at the search layout which will search all the 5 dropdowns and get the result....

    Something similar to 'Any Phone'...'Any Address' ... search in advanced search view....

    Thank You,
    Aprameya

  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: Searching many fields with one field

    Hi Aprameya

    Have a look at the file modules/Contacts/metadata/SearchFields.php.
    The field address_street definition tells sugar to look at two different fields.

    PHP Code:
            'address_street'=> array('query_type'=>'default','db_field'=>array('primary_address_street','alt_address_street')), 
    You need to do the same for your 5 fields.

    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
    aprameya is offline Member
    Join Date
    Jun 2009
    Posts
    8

    Default Re: Searching many fields with one field

    Hi Andopes,

    Thanks for your reply.... I am not clear how to do this... In contacts module, i dont see "address_street" field definition... but this suddenly appears in search alone.... In my case, i have 5 dropdowns.....
    So should i be defining a new dropdown field and add it to advanced search?

    Lets call it 'AnyWorkingField'

    and add this line in modules/contacts/metadata/SearchFields.php

    Code:
    'AnyWorkingField'=> array('query_type'=>'default','db_field'=>array('WorkingField1','WorkingField2','WorkingField3','WorkingField4','WorkingField5')),
    But this is not working....

    What should i do?

  4. #4
    aprameya is offline Member
    Join Date
    Jun 2009
    Posts
    8

    Default Re: Searching many fields with one field

    Hi,

    Can someone help me with this?

    Thank You.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. help with searching date fields
    By ptemplin7 in forum Help
    Replies: 2
    Last Post: 2009-02-01, 06:01 AM
  2. Searching custom fields
    By AGB21 in forum Help
    Replies: 1
    Last Post: 2007-11-19, 03:52 PM
  3. searching custom fields
    By beefjerky in forum Help
    Replies: 0
    Last Post: 2007-04-17, 06:48 PM
  4. Searching multienum fields
    By russellp in forum Help
    Replies: 3
    Last Post: 2006-12-11, 08:53 PM
  5. Searching on custom fields
    By cweston in forum Help
    Replies: 2
    Last Post: 2006-07-20, 07:38 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
  •