I use the native merge functionality to glue two duplicate contacts together programmatically:
merge target source;
Yet this invokes the following error:
12:06:49:251 USER_DEBUG |DEBUG|DML_e: Merge failed. First exception on row 0 with id 0030-removed---tQAG; first error: INVALID_FIELD_FOR_INSERT_UPDATE, Unable to create/update fields: Name. Please check the security settings of this field and verify that it is read/write for your profile or permission set.: [Name]
I'm confused. For once, the Name field is exactly the same for both contacts. Also, I thought my Apex would run with maximum permissions in any case.
What is a good way to merge two Contacts, ideally copying tasks, attachments etc as well?