+ Start a Discussion
stefanodlstefanodl 

Many-to-many objects

Hello,

my question is about many-to-many relationship.

I've created three new objects and three new many-to-many relationship in order to relate an account with these three object.

New Objects are

Brand = new object (related to Account) for all those account with type equals to Brand
Group = new object (related to Account) for all those account with type equals to Group
Management Company = new object (related to Account) for all those account with type equals to Management Company

ATB = relationship account-brand
ATG = relationship account-group
ATMC = relationship account-management company

In this way i can relate Accounts with accounts  of the above types (Brand, group and Management company) and for one account I have related list with the other accounts.

Example:

ACC1 = Management company
ACC2 = Brand
ACC3 = Group

ACC1 --> Brand related list will show ACC2 and Group related list will show ACC3

Then I've created triggers in order to create automatically new objects:

if ACC2 is a Brand, the trigger will create a Brand record with name ACC2

Now, my problem is that I can relate ACC1 to ACC2 easily using ATB but I'd like to have the relation ACC2 to ACC1 automatically done.

Can someone help with with this?

Thanks in advance.

Stefano

bidhanpatnaikbidhanpatnaik

Why can't you use the same trigger to create a relationship object as well. At this point you have both ACCT1 ID and ACCT2 ID, so creating a new record in the relationship object should be easy, no?