Here is the scenario on our Sugar 6.2 install, slightly simplified, but hopefully will get to the core of the issue:
We have universities as accounts.
The contacts for those universities are all lecturers. The lecturers are contacts that represent the university in some way - their department or some area of administration.
We also have a bunch of contacts who are students at those universities. They need to be linked to the universities, but they are students and not department representatives. They need their own relationship. The students are a student of just one university at any time.
So, I set up a relationship (many-to-many) between accounts and contacts and called the relationship "Students". When viewing the university I can see all the students it has, and can add and remove students. That is cool.
When I go to the contact record I see that I can select a single university that he contact is a member of. That is also cool.
I can see in the accounts that the list of contacts and the list of students are separate and independent. That is just too cool.
Now my question: the relationship was set up as a many-to-many, because that is the closest option I could find. I actually needed many-to-one from Contacts-to-Accounts. However, what Sugar has given me *is* a many-to-one on the contact admin page. How did that happen, and can I rely on it working like that in the future? i.e. is it a feature or a bug? Hopefully it is a feature.
The original developer set up the "student of" link in the contacts as a relate field. This all fine until we need to merge duplicate university accounts, and find that, not being a true relationship, the students at the university being merged in just get dropped from being a student anywhere. At least with a proper relationship the students get merged in when university duplicates are merged. But can I rely on Sugar giving me a many-to-one when Studio only allows me to select a many-to-many?
I hope that makes sense. It is hopefully quite simple, and *appears* to be working, but my coding Bat-sense is telling me there is a nasty surprise waiting for me further down the line.
-- Jason


LinkBack URL
About LinkBacks



Reply With Quote
Bookmarks