How to Delete a Master-Detail Relationship in Salesforce : Bijay Kumar
by: Bijay Kumar
blow post content copied from SalesForce FAQs
click here to view original post
### Summary of Content The article discusses how to manage relationships between objects in Salesforce, specifically focusing on the Master-Detail Relationship (MDR) and how to convert it to a Lookup Relationship. 1. **Master-Detail Relationship (MDR)**: In Salesforce, this relationship means that the child (detail) object cannot exist without the parent (master) object. If the parent is deleted, the child is also deleted. For example, if a hospital's ENT Department (master) is deleted, all doctors associated with that department (child) are also deleted. 2. **Need for Change**: The author decided that tasks (child records) should not be dependent on projects (parent records) and should exist independently. To accomplish this, the MDR needs to be deleted and replaced with a Lookup Relationship, which allows the child object to exist independently of the parent. 3. **Deleting MDR**: The process of deleting an MDR is not straightforward. If a rollup summary field is associated with the parent, it must be deleted first. The article provides step-by-step instructions on how to delete the MDR, including: - Accessing the Object Manager in Salesforce. - Finding the specific object and its fields. - Deleting the rollup summary field if necessary. - Successfully deleting the MDR after removing any dependencies. 4. **Conclusion**: The article concludes by summarizing the process and encouraging readers to understand the implications of deleting a master-detail relationship. ### Additional Context - **Master-Detail vs. Lookup Relationship**: Understanding the difference between these two types of relationships is crucial. While MDR enforces a strict dependency, a Lookup Relationship allows for more flexibility, letting the child exist without the parent. - **Salesforce**: Salesforce is a widely used customer relationship management (CRM) platform that enables businesses to manage their interactions with customers and streamline processes. ### Hashtags for SEO #Salesforce #MasterDetailRelationship #LookupRelationship #SalesforceAdmin #CRM #SalesforceTips #DataManagement #SalesforceTutorials #SalesforceLightning #SalesforceDevelopment
I created a custom object called ‘Project’ and linked it to another object called ‘Task’ using a Master-Detail relationship. When we create MDR between two objects, the child record cannot exist without a parent.
Later, we decided that tasks should not be completely dependent on projects. Instead, tasks should exist on their own even if the project is deleted.
To achieve this, you need to delete the Master-Detail Relationship between Project and Task and replace it with a Lookup Relationship.
In this article, we will learn how to delete a master-detail relationship in Salesforce. We will provide an overview of the master-detail relationship and discuss important considerations to keep in mind when deleting it.
Master-Detail Relationship in Salesforce
When we create a master-detail relationship between two objects, the master side object is the parent object, and the details side object is the child object.
In MDR, the child object record does not exist without a parent. This means that whenever we delete the parent object record, the associated child record is also deleted along with the parent record.
For example, for the hospital, we created the master object named Department, and in that, we have one record, the ENT Department.
Then, we have another child object named Doctor’s Details, which contains records of doctor details associated with the ENT department.
Now, whenever we delete the ENT Department record from the Department (master) object, all the associated doctors’ details records get automatically deleted from the child object.
Deleting Master-Detail Relationship in Salesforce
When we attempt to delete the master-detail relationship, it sometimes displays an error stating that the field cannot be deleted. This happens because we had created a rollup summary field on the parent object.
In Salesforce, deleting the master-detail relationship is quite tricky, but it is possible to do so. First, we need to delete that rollup summary field, and then we will be able to delete the master-detail relationship in Salesforce.
If the master-detail field has been used in the Visualforce pages, then we cannot delete the master-detail relationship.
Delete a Master-Detail Relationship in Salesforce
Below, I will explain the steps to delete a master-detail relationship in Salesforce or convert a master-detail relationship into a lookup.
- When you log in to the Salesforce org, the Object Manager tab will be visible on the Home Page.
- Click on it, and in the search option, search for the object on which you want to delete the master-detail relationship.
- Here, I have selected the Student_c custom object. Click on that object.

- Then, you will see the Fields and Relationship option, in which we manage the datatypes, labels, and API names of fields. You can see the Faculty field with the Master-Detail relationship that we want to delete.
- To do this, click on the dropdown arrow located on the right side of the screen. Then, click on it, and you will see the “Edit” and “Delete” options. Click on the Delete option.

- After clicking the delete option, a window will pop up, displaying instructions. Then, click the Delete button.

- However, sometimes you may encounter an error stating ‘Unable to Complete the Requested Change,’ along with the reason and the section where the error occurred.
- Here, we can see that the error occurred in the Faculty Custom Fields section: All Student Count. This is the roll-up summary field.

- Let’s check on the parent object to see if its roll-up summary is present or not. For that, go to Object Manager -> Search Faculty (Parent object of Student_c).

- In the Fields and Relationships section, we can see the Rollup summary field. We need to delete that field. To do so, click on the dropdown arrow, and you will see the option to delete.
- Click on the Delete option, and then you will see that the field is deleted. Here, you should be aware of one important thing: we need to hard delete the rollup summary field, which can be found in the Deleted Fields option. Click on it.

- Then, you will see the “Erase” and “Undelete” options. We need to delete that field permanently, so click on the Erase option.

- After deleting the rollup summary field, we need to repeat steps one to three again, as we have already seen. As you click on the Delete button, you will see that the Master_Detail Relationship field will be deleted successfully.
Conclusion
I hope you now have an idea about deleting the master-detail relationship in Salesforce. We have reviewed the master-detail relationship and the key considerations to keep in mind when deleting it.
Additionally, we have seen step-by-step how to delete master-detail relationships in Salesforce Lightning.
You may like to read:
- Create Master-Detail Relationship in Salesforce
- Convert Lookup Relationship into Master-Detail Relationship in Salesforce
- Convert a Master-Details Relationship into a Lookup in Salesforce
- Delete Custom App in Salesforce
The post How to Delete a Master-Detail Relationship in Salesforce appeared first on SalesForce FAQs.
October 31, 2025 at 06:51PM
Click here for more details...
=============================
The original post is available in SalesForce FAQs by Bijay Kumar
this post has been published as it is through automation. Automation script brings all the top bloggers post under a single umbrella.
The purpose of this blog, Follow the top Salesforce bloggers and collect all blogs in a single place through automation.
============================

Post a Comment