News & Updates
Training & Certification
to create and rate content, and to follow, bookmark, and share content with other members.
Can't change relationship between Accounts and Contacts 1:Many
Question asked by
on Nov 12, 2014
on Jun 25, 2015 by Justin Kuehlthau
Show 1 Like
Hi, I have a problem with the relationship between Accounts and Contacts module. By default it is Many : Many and I would like to make it One to Many. The drop down list int he studio is just not active. Thank you all for your help.
No one else has this question
Mark as assumed answered
This content has been marked as final.
Show 5 comments
(Required, will not be published)
Nov 12, 2014 6:33 AM
Maybe I am wrong, but I believe there is a certain kind of historical issue with this question in SugarCRM.
At least in SugarCRM CE 6.5.x, although relationship between Accounts and Contacts is set to Many to Many, it actually works as a One to Many relationship (OMR).
In a Many to Many relationship (MMR) you would see a subpanel for the related module in every detailview, ie: in Contacts detailview there should be an Accounts subpanel and in Accounts detailview there should be a Contacts subpanel.
However, if you look at Contacts detailview you will notice just an Account related field in the main data panel; the expected Accounts subpanel does not exist. Furthermore, you can edit the Contact and assign it to a single Account through the related field. So, at last, although in Studio you see a MMR, you are operating in a OMR scenario, ie, you wouldn't need to do anything to get what you want.
It would be very interesting if someone at Sugar could explain this.
Hope this helps!
Show 1 Like
Nov 12, 2014 8:16 PM
Jaume is on the right track with his explanation, but there is one thing that I wanted to add to it.
Out of the box, the relationship between Accounts and Contacts is Many to Many, but unlike other Many to Many relationships, there isn't an Accounts subpanel in the Contacts module, only a relate field. However, a Contact can be related to multiple Accounts, this has to be done from the Accounts side.
Here's a scenario that should help explain this:
- I have two Accounts in SugarCRM, Account 1 and Account 2.
- I have two Contacts in SugarCRM, John Doe and Jane Smith
- When I view John Doe in the Contacts module, his Account is listed as Account 1. When I view Jane Smith in the Contacts module, her Account is listed as Account 2.
- If I navigate to the Account 2 record and scroll down to the Contacts subpanel, I see both Jane Smith and John Doe.
- If I navigate to the Account 1 record and scroll down to the Contacts subpanel, I only see John Doe.
- When viewing the Contacts module List View, if I have the Account Name as one of the columns, I will see three Contacts:
1. Jane Smith - Account 2
2. John Doe - Account 1
3. John Doe - Account 2
John Doe is listed once for each Account he is related too.
As Jaume mentioned, the stock relationship will behave based on your requirements.
Advanced Support Engineer
Show 0 Likes
Nov 12, 2014 9:17 PM
Thank you for confirming mi previous answer.
I would like to say a couple of words about this question, as I don't really understand this behaviour:
1) Why the relationship is Many to Many but the UI works as if it was One to Many? I find this very confusing for a SugarCRM beginner. At last you simply say: "ok, it makes no sense but it runs this way".
2) Furthermore, if you work the way you suggested, some problems arise. Let's follow your example:
i) You are in John Doe editview and you assign him to Account 1.
ii) You go to Account 1 detailview and in the Contacts subpanel you see John Doe. It's ok.
iii) Now, you go to Account 2 detailview and you add John Doe to the Contacts subpanel. Now John Doe belongs to both Account 1 and Account 2. But...
iv) ... now you come back to John Doe detailview and in the Account related field now it says... Account 2!!
So, in the Contact detailview you will always see the last Account that you related to that Contact (Account 2 in this example), although the rest of the fields (phone numbers, addresses, etc.) might refer to another account (Account 1).
Don't you think this is a strange behaviour?
Will be glad to hear your thoughts about this questions. Thank you!
Show 2 Likes
May 3, 2015 9:41 PM
when I associated one contact with more than one account, the contact is not listed more than once in the contacts list view
nor is the contact listed more than once in reporting
How will this relationship affect Sugar Portal users?
Show 0 Likes
Jun 25, 2015 10:33 AM
Is there a good way to revert the Account/Contact relationship back to the original Many to Many relationship in v7?
Show 0 Likes
Retrieving data ...
how can I generate advanced report as pdf?
Challenges with image field types: viewing images, mobile app capture.
failed on install 80%
Does anyone have a logic hook that will send an email (not from email template) to a user when a Lead is assigned to them?
Days Since Last Contact and Last Contact Type?
Re: Accounts Contacts Relation (cardinality, subpanels)