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

Master-detail between 2 objects

How to create a custom object with a Master-Detail relationship with another custom object?


Best Answer chosen by Admin (Salesforce Developers) 

You related two objects together by adding a custom field or type "Master-Detail" or "Lookup". So if you want  CustomObject2 to be the child of CustomObject1, create a custom field or type "Master-Detail" on CustomObject2, relate it to CustomObject1 and save the custom field. That will create a Master-Detail relationship between CustomObject1 (master) and CustomObject2 (child).