How to create Master Detail relationship in Salesforce?

I have two custom objects Member and Interest.


Note: From the child object create Master Detail field.

I want Interest Object to be the child of Member object, so that each member can have multiple interests.

To achieve this, follow the below steps

1.  Go to Interest object.

2. Go to Custom Fields & Relationships section.

3. Click "New" button.


4. Select "Master-Detail Relationship".

5. Click "Next" button.


6. Select Member object in "Related To" field.

7. Click "Next" button.



8.  Fill the required details.

9. Click "Next" button.


10. Since it is Master-Detail relationship, the field should be visible to all profiles.

11. Click "Next" button.


12. Click "Next" button.


13. Click "Save" button.


14. Go to objects and check whether Master Detail relationship has been implemented successfully.

3 comments:

  1. Cannot Create Master-Detail Relationship
    You cannot create a new Master-Detail relationship on an existing custom object if records already exist. You must first create a Lookup relationship, populate the lookup field with data in all records, and then change the relationship type to Master-Detail.

    Now what to do ?

    ReplyDelete
    Replies
    1. Delete all the records from the object which is gonna be the child record and then create the Master Detail relationship.

      Else, create lookup relationship. Map all the child record to their respective parent records. Change Lookup to master detail relationship.

      Cheers!!!

      Delete
  2. After creating the look up relationship, the mapping of all child records to their respective parent records is important steps, and then only you will be able to change the relationship into a Master-Detail relationship.

    ReplyDelete