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

Updating look up- Master detail

Iam trying to update a lookup 


I have an object A   and Object B     : Master Detail Relationship ( Master Object A)


Object B has a master detail look up field of A 


When Iam creating new record of Object B it gets created  but when i am updating the Object B it doesnt allow me to update bcoz I have already inserted or passed the value of Lookup ( that is Object A field) 


How to go about updating Master field in child object .. Is there any way to do 


It should allow you to updateif that master field is not null.

Can you describe exactly what is the error coming?



If I am not wrong you want to allow reparenting ?
for this you have to go to the fields on Object B look for the field that points to Object A.
Edit it check the allow reparenting checkbox(there should be something similar).

This will allow you to reparent the records

When you create your MD Lookup field, you should have a cdheckbox that allows you to reparent child records after they're created. Check your relationship field and see if you have this checked. 

In salesforce master field is not writable.


You can change master detail field in child object to check the "Allow reparenting" checkbox.

You need to follow follwing step:

Go to setup -> App Setup -> Create -> object -> select object B -> go to your field which is of type master detail to A  -> click on edit button -> their is a checkbox "Allow reparenting".