Results 1 to 4 of 4

Thread: Storing fields related to a relationship

  1. #1
    tickletoe is offline Member
    Join Date
    Feb 2011
    Location
    London, UK
    Posts
    13

    Default Storing fields related to a relationship

    Hello,
    I am new to sugarCRM and am enjoying getting to know it and thanks in advance for any help here.

    I wanetd to know the best way of storing information that relates to a relationship between two modules. For example: Accounts and Contacts have a many-to-many relationship and I want to store a field called status that is related to the Account/Contact. This field will have different values for each Account/Contact relationship.

    SugarCRM has created a table called accounts_contacts but this seems to only hold the keys (account and contact) to the reationship. Do I need to add extra columns to this table? Or do I need another module called AccountContact? Or something else?

    Can this be done in studio. I don't want to rush into modifying code if it can all be done via the admin gui.

    Many thanks
    Scott

  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: Storing fields related to a relationship

    Hi Scott

    This is possible but can not be accomplished through Studio.
    You need to write some code.
    Take a look at relationships calls_users and opportunities_contacts. The related code can be found at modules/Calls/Call.php and modules/Opportunities/Opportunity.php

    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
    tickletoe is offline Member
    Join Date
    Feb 2011
    Location
    London, UK
    Posts
    13

    Default Re: Storing fields related to a relationship

    many thanks for you reply.

  4. #4
    cumanacr is offline Junior Member
    Join Date
    Mar 2011
    Location
    Costa Rica
    Posts
    3

    Default Re: Storing fields related to a relationship

    Quote Originally Posted by andopes View Post
    Hi Scott

    This is possible but can not be accomplished through Studio.
    You need to write some code.
    Take a look at relationships calls_users and opportunities_contacts. The related code can be found at modules/Calls/Call.php and modules/Opportunities/Opportunity.php

    Cheers
    Hi André, I trying to do same Scott is doing, I already understood that I need to do some coding, but I have a BIG doubt:

    IF i do this changes, will it be upgrade safe?

    Thanks in advance

    Cheers

    Cristian Umaña

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Storing and Updating Calculated fields
    By jlabuelo in forum Developer Help
    Replies: 0
    Last Post: 2010-10-13, 05:46 PM
  2. Replies: 1
    Last Post: 2010-09-10, 04:33 PM
  3. selected fields are not storing in the contact table
    By akil_123 in forum Developer Help
    Replies: 0
    Last Post: 2010-02-08, 08:17 AM
  4. Leads not storing edits to Custom fields
    By ptemplin7 in forum Developer Help
    Replies: 7
    Last Post: 2008-06-05, 04:22 PM
  5. Replies: 0
    Last Post: 2008-05-23, 12:06 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
  •