function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
blakeLLblakeLL 

Many to Many relationships among custom object and accounts

I know about the master-detail relationship field and the lookup relationship field, but I have what I believe is a different scenario. I have a custom object that contains a list of inventory parts that our customers use. The problem is that come customers use multiple parts, and some parts are used by multiple customers.
 
Seems that if I have only figured out a one-to-many relationship for these fields... can I do more than that, and how?
ckempckemp
Blake,

To define a many-to-many relationship, you have to create a custom object to use as a go-between.  In this case, we'll assume your custom object is called MyCustomObj and we'll call the new custom object, MyCustomObjAccounts.  Create two custom Lookup fields, one for MyCustomObj and one for Accounts.

After you have finished setting up the object, you can go to your MyCustomObj tab and click on an instance of the MyCustomObj tab.  Under that you'll have an "Accounts" section where you can associate accounts to this instance of MyCustomObj.

For an example, check out Chapter 6 in "Creating On-Demand Applications: An Introduction to the Force.com Platform".


cK