I am using the
upsert statement to update the custom object
Customer__c with two master-detail fields. The fields reference custom
Customer__c c = new Customer__c(); c.Contact__c = ConId; c.Subject__c = SubId; c.External_Id__c = '100201'; upsert c External_Id__c;
While trying this, I am getting an exception:
System.DmlException: Upsert failed. First exception on row 0; first error: INVALID_FIELD_FOR_INSERT_UPDATE, Attempting to update (as part of an upsert) parent field Contact__c with new value 003g000000aaayLAAQ, current value is 003g0000009c9xyAAY: [Contact__c]
It's working in a developer sandbox and not working in a full copy sandbox.
Note: In the full copy sandbox, Person Account is Enabled.