0

Can we create Many to many relationship between Account and Contract? I have done this with junction object but i have one doubt as Contract have lookup relationship with Account which is required on page layout. So if i create one account "Acc1" then i want to create one contract for this Account as "Contract1" which i can create from its related list. Now, Same contract i want to link to another account say "Acc2". For this, i will add data into junction object to link Contract1 to Acc2. This is working fine. But as contract have lookup filed with Account, that contract will be displayed under COntract related list as well and at the same time, i need to add same contract in junction object. Is this right approach? Please help.

0

Short answer: it depends.


Long answer:

The standard contract, as intendend by Salesforce has a 1-to-many relationship on salesforce. It means, that you company just have a contract with another company.

There are many approaches for you case and it'll depend mostly on why you need a many-to-many relationship.

If your company indeed have multi-party contracts and all Accounts have the same "participation" on the contract, you can simply hide the Contract related list and always use the junction object.

If the second company is just an auxiliary, then you can use the Account field for the main account and the junction object for the accounts of interest (maybe add a field to represent their role on this contract).

Also, you may consider dropping the contract and using a custom object to represent exactly what you want it to represent.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.