Results 1 to 7 of 7

Thread: make a "real" relationship with field "Relate"

  1. #1
    zaska's Avatar
    zaska is offline Senior Member
    Join Date
    Sep 2008
    Posts
    99

    Default make a "real" relationship with field "Relate"

    Hola

    I need little help understanding the field "Relate". When add it in Studio it creates a table module_cstm and add the related IDs in the corresponding columns when saving a record.
    In DetailView the relationship is there, but not in the subpanel. It do not populate the relationship tables.
    How can I make when saving a record also to create a "real" relationship between the modules? One way is using custom logic hooks (after_save) and remove all buttons in the subpanel, but I'm sure there's an easy way.

    Thanks

  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: make a "real" relationship with field "Relate"

    Hi zaska

    Create a relationship instead.
    Go to Admin -> Studio -> <Main Module> -> Relationships
    Create a new One to Many Relationship with the <Secondary Module> -> Deploy
    SugarCRM will automatically generate the relationship metadata, subpanel entries for the <Main Module> and the <Main Module> field in the <Secondary Module> layouts.

    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
    zaska's Avatar
    zaska is offline Senior Member
    Join Date
    Sep 2008
    Posts
    99

    Default Re: make a "real" relationship with field "Relate"

    Hi andopes,

    I've done this. But forgot to mension that I want two (or more) fields and all they to relate to the second module.

    Field1 -> selecting contact1
    Field2 -> selecting contact2
    Field3 -> selecting contact3

    Then all these three contacts to relate to the module and show them in the subpanel. Also in DetailView Field1 to show a link to contact1, Field2 to contact2 and so on.

  4. #4
    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: make a "real" relationship with field "Relate"

    So you can copy the entries on layoutdefs, vardefs and relationship, duplicate them and modify the enough to implement new set of layoutdefs, vardefs and relationships entries.
    Go to Admin -> Repair -> Quick Repair and Rebuild

    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.

  5. #5
    zaska's Avatar
    zaska is offline Senior Member
    Join Date
    Sep 2008
    Posts
    99

    Default Re: make a "real" relationship with field "Relate"

    When selecting a new contact the old relationship will still be there. I've made it with after_save script.

    Thanks

  6. #6
    Gebremedhin is offline Member
    Join Date
    Apr 2009
    Posts
    6

    Default Re: make a "real" relationship with field "Relate"

    Hi,

    I have been working on something similar but only using one relationship per module. I noticed one of the responses says that if you build the relationship in module builder it should automatically give you the relate field but I have done that and the relate field is not showing. The relationship, subpanels, everything on the back end looks like its there but no relate field and if I try to add one manually it does not create a relationship record in the db. Is that auto-populate feature only with built-in modules? If so, what do I need to do to connect a relate field to a relationship between two custom modules?

    Thanks,
    Hassab

  7. #7
    edg
    edg is offline Sugar Community Member
    Join Date
    Feb 2007
    Location
    Atlanta, GA
    Posts
    46

    Post Re: make a "real" relationship with field "Relate"

    I posted a "how to" in the tutorial section about how to create a Relate field and then associate it with a Sugar relationship.

    See the following post: http://www.sugarcrm.com/forums/showthread.php?t=47776

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 0
    Last Post: 2009-01-19, 08:32 PM
  2. Search 2 custom field like "any email" / "any phone"
    By johnwoo in forum General Discussion
    Replies: 1
    Last Post: 2007-10-29, 02:17 AM
  3. Replies: 0
    Last Post: 2007-07-27, 08:13 AM
  4. Replies: 0
    Last Post: 2005-10-22, 05:23 AM
  5. Replies: 0
    Last Post: 2005-05-06, 06:43 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
  •