Results 1 to 6 of 6

Thread: One-Many Relate field to Search

  1. #1
    madhrishi is offline Senior Member
    Join Date
    Feb 2009
    Posts
    99

    Default One-Many Relate field to Search

    Hi,

    I have one to many relationship between Contacts[primary] and a custom module[related module]... Now, i need to add a relate field for the custom module to Contact's search... A relate field for contact is readily available in the custom module... but relate field for custom module is not available....

    How do i do this?

    i.e, Just like "account_name" in contact search......i want "custom_module_name" in contact search...

    Thank You.

  2. #2
    crmbalah is offline A Prolific Poster
    Join Date
    Mar 2009
    Location
    chennai
    Posts
    418

    Default Re: One-Many Relate field to Search

    HI
    try to customize the contact module subpaneldefs.php

  3. #3
    madhrishi is offline Senior Member
    Join Date
    Feb 2009
    Posts
    99

    Default Re: One-Many Relate field to Search

    But how will that affect the search view??

    What i want is, a relate field for the custom module in Contact's search ..... contacts and custom have one - many relationship....

  4. #4
    madhrishi is offline Senior Member
    Join Date
    Feb 2009
    Posts
    99

    Unhappy Re: One-Many Relate field to Search

    Any one plss? I thought there could be a very simple solution for this

  5. #5
    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: One-Many Relate field to Search

    crmbalah, your suggestion sounds like a LOTERY!!

    madhrishi, when creating a relationship one to many between Contacts and your Custom Module, a subpanel of Custom Module will be rendered into Contacts DetailView and the Contacts field will be rendered into Custom Module views.
    So no Custom Module field is created by default on Contacts module, the way you need to create it by hand into extended vardefs of Contacts and render it into searchdefs.php.
    You also will need to create a custom controller for Contacts to override the $this->bean as an instance of a new class which extends the default Contact class.
    This new class should implements the method create_new_list_query to deal properly with the new Custom Module field when generating the sql query.

    Let us know if you need further details.

    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.

  6. #6
    madhrishi is offline Senior Member
    Join Date
    Feb 2009
    Posts
    99

    Default Re: One-Many Relate field to Search

    Thank You Andopes..

    I was ok until

    "You also will need to create a custom controller for Contacts to override the $this->bean as an instance of a new class which extends the default Contact class.
    This new class should implements the method create_new_list_query to deal properly with the new Custom Module field when generating the sql query."
    How do i do this? I have no coding knowledge

    I thought of adding the custom relate field to contacts only because search by contacts in custom module field is not working...

    You have previously answered this issue...here... do u think i am also facing the same issue??

    http://www.sugarcrm.com/forums/showt...ght=any+search

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Issue - One-Many relate field search
    By madhrishi in forum Developer Help
    Replies: 0
    Last Post: 2009-07-09, 10:43 AM
  2. Search Relate Field
    By Niggy in forum Developer Help
    Replies: 1
    Last Post: 2009-01-22, 11:02 AM
  3. search on relate field
    By rma in forum Developer Help
    Replies: 3
    Last Post: 2008-08-01, 08:18 PM
  4. Search on relate field
    By mikesolomon in forum Help
    Replies: 13
    Last Post: 2008-06-28, 06:30 PM
  5. Search by 'Relate To' field in ListView screen
    By Superman in forum Developer Help
    Replies: 4
    Last Post: 2008-03-09, 03:54 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
  •