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
sd2008sd2008 

How to update a master/detail field or lookup field?

I got an error message :

Attempting to update (as part of an upsert) parent field obj__c with new value a0740000002T9LgAAK, current value is a0740000002T9LmAAK116

Best Answer chosen by Admin (Salesforce Developers) 
werewolfwerewolf
Yes, although there are some functionalities you only get on master-details right now and in Spring '09, like cross-object workflow (if both the master and the detail are custom objects).  But generally a lookup is effectively the same thing without the cascade delete.

All Answers

SuperfellSuperfell
Didn't we just go through this? you can't change the parent for a master/detail relationship.
sd2008sd2008

Is there a way to work around this?

 

thanks

SuperfellSuperfell
don't use master/detail relationships.
sd2008sd2008
What is the difference between Master/Detail Field type and Lookup Field Type?
werewolfwerewolf
A master/detail specifies that the parent/child relationship is explicit -- that means that you can't change the parent field (which is what you were trying to do here), and that if you delete the parent, it cascade-deletes the children.
sd2008sd2008
and Lookup Field will server the basic functionalities as master/detail, except Cascade part?
werewolfwerewolf
Yes, although there are some functionalities you only get on master-details right now and in Spring '09, like cross-object workflow (if both the master and the detail are custom objects).  But generally a lookup is effectively the same thing without the cascade delete.
This was selected as the best answer
sd2008sd2008
thanks