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
Michael SalgoMichael Salgo 

One Custom Object Set Up As Related List for Several Objects

Is it possible to have one custom object set up as a related list for several Salesforce objects (custom or standard)?

For example, if I have a state identifier object which allows a user to set an ID per state attributed to a Salesforce object, I want the user to be able to type in a Contact for example, and add several state IDs naturally and fluidly via related lists.

We figured that related lists are the best for this as opposed to a lookup field which requires you to set up the state and ID first and then apply it to the Salesforce object which is the reverse of how the flow would be expected to work.

Thanks,
-Michael
Best Answer chosen by Michael Salgo
bob_buzzardbob_buzzard
A related list is controlled via lookup fields.  The child object has a lookup to the record it will appear as a related list of.  In this case you'd have a lookup from the State Id to a contact. Then from the contact record view page you can press the 'New' button on the State Id related list and that will allow you to define a State Id record with the contact lookup already populated.

One custom object can be related to a number of Salesforce objects through multiple lookup fields. So you could have lookups to Contact, Account, Opportunity on the state id for example.  However, this means that if you deleted the state identifier it would be deleted from all of these records related lists.

All Answers

bob_buzzardbob_buzzard
A related list is controlled via lookup fields.  The child object has a lookup to the record it will appear as a related list of.  In this case you'd have a lookup from the State Id to a contact. Then from the contact record view page you can press the 'New' button on the State Id related list and that will allow you to define a State Id record with the contact lookup already populated.

One custom object can be related to a number of Salesforce objects through multiple lookup fields. So you could have lookups to Contact, Account, Opportunity on the state id for example.  However, this means that if you deleted the state identifier it would be deleted from all of these records related lists.
This was selected as the best answer
Michael SalgoMichael Salgo

Thanks, Bob!

I had tried Master-Detail Relationship fields at first which has a cap of two Salesforce objects and requires each to be fileld in. This lookup field worked like a charm to provide the "New" button on the desired Salesforce object (Contact, Account, etc.).

Thanks again,
-Michael