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
Jan MattesonJan Matteson 

Copy Activity History with Visual Workflow

I have a custom object that spawn records on other custom objects via visual workflow (similar to a lead conversion to account/contacts).  I want to copy the activity history and notes/attachments from the original record to the new records.  

Activity history doesn't seem to be something I can access directly - ApiException: entity type ActivityHistory does not support query.

So, I have two questions - first, how to access the source records and second, how to use a loop and sobject collection to write the new records.  
Jan MattesonJan Matteson
This is resolved.  I was able to move Activity history by moving tasks and events separately.  Attachments can't be move because the parentID is read only but was able to copy to the new record.