[SalesForce] How to transfer attachments from one object to another

I have two custom objects objA and objB. I want to transfer all the records available in objA to objB. For this purpose i am using DataLoader to transfer the records. I want to transfer the records that have Notes and Attachments also. How to transfer the attachments one object to another. After transferring the records from objA to objB, automatically records ID and Name(Name auto generated in my case) will change. Attachment parent ID related to objA, but in objB it is changed. How can we identified which attachment is related to which record. Can anyone suggest me.

Best Answer

You cannot transfer attachments, you have to create new ones.

  1. In data loader, move all records from object A to B (keeping a column for the old ID)
  2. In the attachments csv, do a lookup to the results file to find the new Parent ID based on the old Object A ID and Parent ID
  3. Insert the attachments using the new parent ID

See this help document on uploading attachments using data loader and org data export.

Related Topic