Results 1 to 6 of 6
Like Tree1Likes
  • 1 Post By christianknoll

Thread: how to add contains, not contains like parameters in string search

  1. #1
    R3dian is offline Junior Member
    Join Date
    May 2011
    Posts
    8

    Default how to add contains, not contains like parameters in string search

    HI i am trying to modifying search on string in which it can not only give the results of first matching string but also in between names and that string not contains like searching. But so far i am unable to locate where to do these changes. can anybody help me out?

  2. #2
    R3dian is offline Junior Member
    Join Date
    May 2011
    Posts
    8

    Default Re: how to add contains, not contains like parameters in string search

    no worries done it achieve the functionality

  3. #3
    yanina is offline Junior Member
    Join Date
    Sep 2011
    Posts
    1

    Default Re: how to add contains, not contains like parameters in string search

    How did you fix this?

    Thanks!

  4. #4
    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: how to add contains, not contains like parameters in string search

    Normally when I need to use custom operators on search, I customize the file list.view.php of my module, and on some method as preDisplay the attribute $query is edited with string replacements and the desired sql query is built.
    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

  5. #5
    christianknoll's Avatar
    christianknoll is offline Sugar Community Member
    Join Date
    Nov 2008
    Location
    Vienna
    Posts
    939

    Default Re: how to add contains, not contains like parameters in string search

    I would rather use SearchFields.php ... ;-)

    Quote Originally Posted by rafael.q.g@hotmail.com View Post
    Normally when I need to use custom operators on search, I customize the file list.view.php of my module, and on some method as preDisplay the attribute $query is edited with string replacements and the desired sql query is built.

  6. #6
    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: how to add contains, not contains like parameters in string search

    You are right searchfields.php is a really better solution, I did not knew its usage.
    So here is a better answer, to add contains filter in your query you could change the searchfields.php file adding to the desired field the follow code:
    PHP Code:
     'your_field'=> array(  
                 
    'query_type' => 'default',  
                 
    'operator' => 'subquery',  
                 
    'subquery' => array(
                     
    'SELECT id FROM module_table where your_field LIKE '            
                
    ),  
                
    'db_field' => array(  
                     
    'id',  
                 )  
            ), 
    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

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Modifying string sent to a search
    By Bianary in forum Developer Help
    Replies: 0
    Last Post: 2010-01-15, 11:32 PM
  2. Custom Search parameters in Sugar CE
    By TheBishopOfSoho in forum Developer Help
    Replies: 1
    Last Post: 2009-06-04, 09:27 AM
  3. To modify parameters of search in Sugar
    By rjnascimento in forum Developer Help
    Replies: 4
    Last Post: 2008-11-13, 05:35 PM
  4. Replies: 4
    Last Post: 2008-04-03, 10:00 AM

Tags for this Thread

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
  •