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
irlrobinsirlrobins 

Unable to update master in a master-detail relationship

Hey all,

 

I have a custom object that is the detail in a master-detail relationship with the Account object. When I create a new instance of the custom object I can select the account (via lookup) that the custom object is related to. But when I go to edit this custom object I am unable to change the master account to different one. I'm logging in as a system admin with view all and modify all permissions for both objects. The OWD for Account is private.

 

Am I missing something obvious here???

Best Answer chosen by Admin (Salesforce Developers) 
sfdcfoxsfdcfox

Master-detail relationships are editable on creation only. You can not change the master of a detail record after creation. This is the design of master-detail relationships. To make the field editable when editing a record, it has to be a lookup relationship.

All Answers

sfdcfoxsfdcfox

Master-detail relationships are editable on creation only. You can not change the master of a detail record after creation. This is the design of master-detail relationships. To make the field editable when editing a record, it has to be a lookup relationship.

This was selected as the best answer
flewellsflewells
You are not missing anything, the parent can't be changed after the child record is saved (even by a system administrator). In one instance, this prompted me to change a Master-Detail relationship to a Lookup relationship because I needed the flexibility to change the records. Changing from a Master-Detail to a Lookup relationship has it's consequences (for example, no more Rollup Summary Fields), so not to be done without considering the impact of the change.
irlrobinsirlrobins

Thanks guys, thought I was losing the plot there.

flewellsflewells

Good news -- with Summer '12 you now have the option to specify if child records can be reparented when setting up a master-detail relationship.  The feature can be enabled for existing master-detail relationships too.