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
DeemoDeemo 

Help with ideas for a many to many relationship - need to link custom object records to contact (many to many)

Hi all, I have a custom object called Rights Pack which are packs sent to current contacts via post. I need to be able to keep Rights pack as 1 record but attach to many contacts, but also need to be able to link 1 contact to many rights packs.
Khan AnasKhan Anas (Salesforce Developers) 
Hi Deemo,
 

I trust you are doing very well.
 

If you need a Many-to-Many Relationship i.e. if one parent has more than one child then you will need to create a junction object. 
  • Create a new custom object.
  • Create a custom field on it of master-detail relation type and select the object as Contact.
  • Create another field of master-detail type and select object as Rights Pack.

Please refer to the below links which might help you further with the above issue.

https://www.jitendrazaa.com/blog/salesforce/deep-drive-in-junction-object-create-many-to-many-relationship-in-salesforce/

https://developer.salesforce.com/docs/atlas.en-us.fundamentals.meta/fundamentals/adg_relationships_many_relationship.htm


I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in future.

Thanks and Regards,
Khan Anas