Contact linked to multiple accounts - How do I see all of the accounts to which a contact is linked?

I'm trying to find a way to list the Accounts to which a Contact is linked in a Sub-Panel of the  Contact Record .

When linking a Contact to an Account, the Contact appears in the Accounts Sub-Panel for that Account, and the Account field in the Contact Record is updated to show that link.

The "problem" we have is that when a given Contact is the Purchasing Authority for 5 to 15 locations of a Customer, the Contact Record contains the Account link for the last time the contact was linked.

I'm thinking I may need to create a new Many-to-Many Relationship for Contact-Accounts, but I'm fearful that doing that would disrupt the standard SugarCRM design.

How do I see all of the accounts to which a contact is linked?

Parents
  • We have had a M-M Contacts/Accounts whereby we have a Contacts Subpanel on the Account and an Accounts Subpanel on the Contact.

    It was implemented by the Sugar Partner who did our original v6.0 Pro deployment back in 2011/2012.
    Our production system is now on Pro v11.0.5 and I just tested the conversion to Ent v 11.0.5 and it's still working.

    I admit I have never looked into how they set this up, but... looking at ti now it seems that they defined a new link on the same relationship as the original...

    In my Contactvardefs.php in the cache folder for the Contacts module I can see the original relationship with link name "accounts":

        'accounts' => 
        array (
          'name' => 'accounts',
          'type' => 'link',
          'relationship' => 'accounts_contacts',
          'link_type' => 'one',
          'source' => 'non-db',
          'vname' => 'LBL_ACCOUNT',
          'duplicate_merge' => 'disabled',
          'primary_only' => true,
        ),
    

    and the new relationship with link name "accounts_contacts"

        'accounts_contacts' => 
        array (
          'name' => 'accounts_contacts',
          'type' => 'link',
          'relationship' => 'accounts_contacts',
          'source' => 'non-db',
          'vname' => 'LBL_ACCOUNTS_SUBPANEL_TITLE',
        ),
    

    Notice that the "relationship"=>"accounts_contacts" is the same in both.

    The link with name accounts_contacts is defined in the Contacts Vardef Extension framework 

    custom/Extension/modules/Contacts/Ext/Vardefs/accounts_Contacts.php

    We then have a subpanel for Contacts on Accounts:

    custom/modules/Contacts/clients/base/views/subpanel-for-accounts-contacts/subpanel-for-accounts-contacts.php

    and a subpanel for Accounts on Contacts

    custom/modules/Accounts/clients/base/views/subpanel-for-contacts-accounts_contacts/subpanel-for-contacts-accounts_contacts.php


    In the DB we still just have the accounts_contacts table that contains these relationships.

    In the Contacts module the original account field is removed from the custom view, and not required. So a contact can be created without any accounts, then accounts can be related from the subpanel.

    Originally we showed the account in the Create Contact view and called it "primary Account", but that was creating confusion as we don't really have the concept of primary Account.

    Is this the best way to implement this? I am not sure...
    But it seems to be working... for now ;)

    FrancescaS

  • Hi Francesca, this looks like what I'm trying to do, and I appreciate you jumping in on this.

    It is the exception where we have a single Contact that needs to be linked to several accounts.  It's a one-to-one relationship in most cases except where a given contact crosses multiple sales territories or multiple companies (all four of our companies share a single installation and are separated with a "Company Code".  The Account name in the Contact record is used in BPM to synchronize data like the Territory Code, Assigned Sales Rep, and Teams.  The mess that's been created is when a Contact is linked to a new account, the Account Name is changed, and if the person isn't paying attention they might even accept the semi-automatic change of address for the contact.

    I debated about setting up additional relate fields for multiple account records in the contact record, but that would create an unholy mess with assignments, processes, and would undoubtedly create confusion in the Service Department.

    It may be time to start looking at customization of the code, and what you have would probably do what's desired.  We're in the on-demand environment and I don't think we want to do customization outside of Studio and BPM for now.

    Thanks again for the suggestion.

    Bud Hartley | Cape Foulwind, NZ (and Oregon, USA)

Reply
  • Hi Francesca, this looks like what I'm trying to do, and I appreciate you jumping in on this.

    It is the exception where we have a single Contact that needs to be linked to several accounts.  It's a one-to-one relationship in most cases except where a given contact crosses multiple sales territories or multiple companies (all four of our companies share a single installation and are separated with a "Company Code".  The Account name in the Contact record is used in BPM to synchronize data like the Territory Code, Assigned Sales Rep, and Teams.  The mess that's been created is when a Contact is linked to a new account, the Account Name is changed, and if the person isn't paying attention they might even accept the semi-automatic change of address for the contact.

    I debated about setting up additional relate fields for multiple account records in the contact record, but that would create an unholy mess with assignments, processes, and would undoubtedly create confusion in the Service Department.

    It may be time to start looking at customization of the code, and what you have would probably do what's desired.  We're in the on-demand environment and I don't think we want to do customization outside of Studio and BPM for now.

    Thanks again for the suggestion.

    Bud Hartley | Cape Foulwind, NZ (and Oregon, USA)

Children
No Data