Employee working for two companies?

Hello,

We have come up with a situation for which there is not an option.

Is there a way to attached a contact/lead to two different accounts?

We have contacts who work, sometimes, for multiple organizations, but there does not seem to be a way.

Can any one point to ways this might be acheived.

Joseph

Create a many to many relationship between the two modules.

Hello Will,

Thanks for the reply.

What is a “many to many relationship” and how do I create one?

Thanks

Joseph

Hello,
go to admin section
go to studio
select accounts
add relationship many to many
and select contact a second module

Regards

Hello,

I think that I figured it out, but I miust have pressed add too many times. Is this what I should have:

accounts_contacts_3* Accounts Many to Many Contacts

The problem, is that I accidentally created about 7 of them. My browser did not react right away, and I must have clicked more than once.

First of all, is this the right relationship that I created?

Secondly, when I go look at my contacts, where would this new “many to many” show up?

Thanks

Joseph

What you’ve created looks correct.

Many to many relationships show up as a sub panel on both sides of the relationship. So in this instance if you go to to the details page of a contact and scroll down you should see a subpanel listing all the contact’s accounts. Similarly if you go to an account you should see a sub panel listing all the related contacts to that account

Regarding creating multiple relationships by accident this is easily done, but thankfully it’s also easily fixed. If you go back into studio and relationships if you double click on one of the extra relationships you’ve added by accident it should take you to a page where you can edit the relationship, which has a delete button at the top you can use to remove the relationship.

Hi,

you actually don’t need to create an additional relationship. The existing relationship between accounts and contacts actually is a many-to-many relationship. You can enable an accounts subpanel for your contacts module by creating the following 2 files:

File nr 1:

custom/Extension/modules/Contacts/Ext/Language/en_us.accounts_contacts.php

with content:


<?php
$mod_strings['LBL_ACCOUNTS_CONTACTS_TITLE'] = 'Accounts';

File nr. 2:

custom/Extension/modules/Accounts/Ext/Layoutdefs/accounts_contacts.php

with content:


<?php
$layout_defs["Contacts"]["subpanel_setup"]['accounts'] = array (
  'order' => 20,
  'module' => 'Accounts',
  'subpanel_name' => 'ForContacts',
  'sort_order' => 'asc',
  'sort_by' => 'id',
  'title_key' => 'LBL_ACCOUNTS_CONTACTS_TITLE',
  'get_subpanel_data' => 'accounts',
);

After creating the files, do a Administrator->admin->Repair->Quick Repair and Rebuild

The advantage of this solution is that the “main account”, which is visible in the upper part of the detailview as “Account Name” will also be listed in the subpanel below.

Disadvantage is that, in case a contact is assigned to multiple accounts, you cannot specify which account will be the main account and displayed above.

Hello Janseiro,

Thanks for this idea.

I do not need one contact/account to be th emain one.

I see this like email. I just want to have the list available.

Can you please contact me?

joehogan@gmx.com

I have added the additional many to many, and there is a new sub panel down towards the bottom of the page.

I would like to try your way as well. It woudl bring the accounts all in the same area, and make it easier to read.

Both are god functional ideas. I want to compare them side by side:)

Thanks

Hi,

I made a small mistake in the second file, the line

 'subpanel_name' => 'ForContacts',

should be:

 'subpanel_name' => 'default',

Hi concerning my suggested solution:

  • It will list the accounts to which the contact is linked in a subpanel below, the field “Account Name” will only display one of them. If wished, the field “account name” can be removed from the detailview and editview in studio

  • The proposed solution is upgrade safe (as long as no big architectural changes are made)

  • There is no need to add any additional many-to-many relationship, as this solution already uses the existing one delivered with the standard installation

Hello Jan

Thanks for the description.

I was under the impression that it listed all the accounts in the same area

If it still lists them below in a subpanel, this is kind of the same solution.

It would be more interesting to have all accounts listed in the same area.

Thanks

Joe