+ Start a Discussion
ibwaveibwave 

Merge Notes & Attachments sections of 2 custom objects

Hello all,

I have created a custom object which is called License. In some cases, the information is duplicated and multiple license objects exists that should be merged as one. However, I do not want to loose all the e-mails that were sent in each license. I would like to merge the licenses and combine all the Notes & Attachments records in the final master license.

I am using C# and the WebServices. However, I am unable to find a way do do this.

Anybody tried this?

Thanks,

Hugo
werewolfwerewolf
All Notes and Attachments have a field called ParentId.  To merge the Notes and Attachments, pick one of your 2 objects to be the Final Master License and get its ID.  Then select all from the Note table and from the Attachment table where the ParentId = the other object.  Then set the ParentId on those Note and Attachment objects to be your final master license and update the objects.  That's it.
ibwaveibwave
Thank you very much for answering so quick.

unfortunately, the error I get is:

ERROR Updating: Unable to create/update fields: ParentId. Please check the security settings of this field and verify that it is read/write for your profile.

Any clues on how I can make it work?

Thanks
werewolfwerewolf
Oh, right, I forgot that field is not updateable.  You'll have to create a new Note or Attachment as a copy of the old one but with the new ParentId, then delete the old one.  Don't forget to empty your recycle bin afterwards, particularly if you'll be doing a lot of this.
ibwaveibwave
Ok it works for Notes & Attachments. The only thing however is that I loose the creation date. But well...if there is no other way, it will do.

I am trying to do the same with 'Activity History'. However, I get the following error:

Creating: entity type cannot be inserted: Activity History

Any ideas.

I really appreciate your help.

Thanks
HardhatHardhat
ActivityHistory is a derived object -- try changing the Task and Event objects that make up the ActivityHistory instead.
ibwaveibwave
You guys are great!

Thanks a million.
CrystalCrystal
I have a new custom object that I need to mass load notes into is that possible? I have a lot of notes and do not want to do this manually.

Crystal


Message Edited by Crystal on 06-23-2008 02:31 PM