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
Subodh chaturvedi 5Subodh chaturvedi 5 

how to convert master detail to lookup

Hi,
.We have position object as a parent and employee is the child object, both of them having the master-detail relationship, we have no. of records in our system for child object. Now our business requirement comes that we have to change MDR to Lookup relationship. So what are the considerations you have to keep in mind while changing it.
 
one consideration I know is if there is any rollup on master  first remove it . 
 Now  suppose there is a roll-up summary in between them and we have lots of data and we don't want to lose data then how can you achieve this.

 
Alain CabonAlain Cabon
Hello Subodh,

You can convert a master-detail relationship to a lookup relationship as long as no roll-up summary fields exist on the master object. You can convert a lookup relationship to a master-detail relationship, but only if the lookup field in all records contains a value.
https://trailhead.salesforce.com/en/data_modeling/object_relationships

Regards
Alain
 
Rowallim TechnologyRowallim Technology
Hi Subodh chaturvedi 5
You can convert the master detail relationship to look up by editing that particular field go to that field ->change data type-> select look up relationship. Note that You can convert a master-detail relationship to a lookup relationship as long as no roll-up summary fields exist on the master object.
If you find this helpful mark it as best answer.
Thanks
Subodh chaturvedi 5Subodh chaturvedi 5
Hi Alian ,

Thanks for the response but what we will do in that case when  there is a roll-up summary in between them and we have lots of data and we don't want to lose data then how can you achieve this.
Subodh chaturvedi 5Subodh chaturvedi 5
Hi Rowallim ,

 Thanks I have same query as I have asked to Alian 
Amruta MhasalkarAmruta Mhasalkar
Hello Subodh,

You will have to delete Roll up summary field. But incase you want to retain that field data, you can create new field and copy the data from Roll up summary field to newly created field and then just delete Roll up summry field.