Results 1 to 6 of 6

Thread: Multiple ACCOUNTS for one CONTACT?

  1. #1
    bleggee is offline Sugar Community Member
    Join Date
    Jan 2010
    Posts
    58

    Question Multiple ACCOUNTS for one CONTACT?

    I deal with many part-time people that do work for multiple Companies ... hence I need to have multiple Accounts related to 1 contact (Many-to-Many). Can Sugar CE (or Pro) do this ? I thought this would be done under Studio/Relationships, but it looks like my Accounts already shoes a Many-to-Many relationship ... how can I get this to work?

  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: Multiple ACCOUNTS for one CONTACT?

    Yes, it is possible to accomplish.
    The relationship between Accounts and Contacts is Many to Many.

    You just need to:
    Create an extended layoutdefs for Contacts and add a subpanel for Accounts, the required relationship already exists.
    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.

  3. #3
    Thorsten Vieten is offline Senior Member
    Join Date
    Oct 2009
    Posts
    33

    Default Re: Multiple ACCOUNTS for one CONTACT?

    I think I had found the below on the forums a while ago:

    1. Copy file <sugar>/modules/Contacts/metadata/subpanels/ForAccounts.php to folder <sugar>/modules/Accounts/metadata/subpanels/
    2. edit file <sugar>/modules/Contacts/metadata/subpaneldefs.php adding to the subpanels arry the following code:



    PHP Code:


    Code:
    'accounts' => array(
       'order' => 90,
       'sort_order' => 'asc',
       'sort_by' => 'name',
       'module' => 'Accounts',
       'subpanel_name' => 'ForAccounts',
       'get_subpanel_data' => 'accounts',
       'add_subpanel_data' => 'account_id',
       'title_key' => 'LBL_MODULE_ID',
       'top_buttons' => array(
        array('widget_class' => 'SubPanelTopButtonQuickCreate'),
        array('widget_class' => 'SubPanelTopSelectButton', 'mode'=>'MultiSelect')
       ),
      ),


    1. Admin->Repair->Clear Template Data Cache
    2. Admin->Repair->Rebuild Relationships

  4. #4
    bleggee is offline Sugar Community Member
    Join Date
    Jan 2010
    Posts
    58

    Default Re: Multiple ACCOUNTS for one CONTACT?

    Works perfect ... You guys are the best ! Thanks

    Brian

  5. #5
    bleggee is offline Sugar Community Member
    Join Date
    Jan 2010
    Posts
    58

    Question Re: Multiple ACCOUNTS for one CONTACT?

    Looks good ... one last question now that I have all the data loaded, with Many-to-Many for Accts<>Contacts:
    If I do a List View on Accounts, I see one of each record (even though there are more than 1 Contact assoc with that Account)
    HOWEVER
    If I do the opposite ... List View of CONTACTS, I see Multiples of the Contact (one for each Account associates with it) ... even though it is not a duplicate contact (If I make a change to 1 contact, all receive that change).
    Do we have any control over this? I want to have the Contacts listed 1 per ... just like Accounts ... no "multiples" showing

  6. #6
    Thorsten Vieten is offline Senior Member
    Join Date
    Oct 2009
    Posts
    33

    Default Re: Multiple ACCOUNTS for one CONTACT?

    Hm, not that I am aware of. The view comes just naturally from the relationships. I mean, on the one hand you want to maintain the data, on the other hand you don't want to display it. Only way to accomodate it I think would be to specify the type of relatiobship the contact has with each account. Then filter out those unwanted relationship types. But this quick solution above doesn't cater for that and it's beyond my knowledge how to implement that :-)

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. One Contact - multiple accounts ?
    By bradcook in forum General Discussion
    Replies: 13
    Last Post: 2011-06-23, 09:31 AM
  2. Replies: 2
    Last Post: 2009-07-28, 06:59 PM
  3. contact to multiple accounts
    By zaska in forum Help
    Replies: 6
    Last Post: 2009-01-22, 08:36 PM
  4. Replies: 1
    Last Post: 2008-09-02, 08:00 PM
  5. 1 contact, multiple accounts
    By dilvie in forum Feature Requests
    Replies: 0
    Last Post: 2005-07-09, 03:10 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
  •