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
RahulBorgaonkar@BritsafeRahulBorgaonkar@Britsafe 

ActivityHistory Object Extract

Hi,

Any Idea how to extract ActivityHistory object data in CSV format.

It is not supported in data loader.
It fulls internal log and gives 'Internal Salesforce.com Error' when tried to extract using Batch apex
It is not supported by BULK api too.
Also cannot directly use into SOQL and has to use in relation with account/contact.

Please share you thoughts/experience. It will help a lot.

Best Regards,

Rahul
Best Answer chosen by RahulBorgaonkar@Britsafe
RahulBorgaonkar@BritsafeRahulBorgaonkar@Britsafe
Hi.

I found the way. Using 'Export All' option from Data Loader you can get all records.

Best Regards,

Rahul

All Answers

sadasiva07sadasiva07

Create an Activities report. Select the Show: Completed Activities option in the middle filter dropdown. This will limit the report to activities that have already taken place.
Select Summary format. This way you will get a count of the rcords automatically.
Then select the desired fields (i.e. Subject, Date, etc...). 
If you want to limit the report to only records with the word Phone or Meeting in the Subject, then you will need to add a Filter of Subject contains Phone, Meeting.
RahulBorgaonkar@BritsafeRahulBorgaonkar@Britsafe
Hi Sadashiv,

I have generated this report in the past and its not showing all records. When I generated the output of this report for specific set of contact name contains word 'dalton' and compared with query below

select Id, CreatedById, CreatedDate, Name, LastModifiedById, LastModifiedDate, OwnerId, LastActivityDate, (SELECT AccountId, Id, OwnerId, IsClosed, WhoId, CreatedById, CreatedDate, ActivityDate, IsDeleted, LastModifiedById, LastModifiedDate, WhatId, Status, IsTask, ActivityType FROM ActivityHistories) from contact where name like '%dalton'
User-added image

Report is always showing less number of records compared to query.User-added image

I can find report records in task/event table but remianing records are in ActivityHistory which I am not able to extract in one go using any of the tool like dataloader, workbench etc.

I have also tried batch apex, bulk api but no success yet.

Do you have any other thoughts?

Please reply

Regards,

Rahul
RahulBorgaonkar@BritsafeRahulBorgaonkar@Britsafe
Hi.

I found the way. Using 'Export All' option from Data Loader you can get all records.

Best Regards,

Rahul
This was selected as the best answer
sadasiva07sadasiva07
FYI u will get only with in 5 years of Activites only from the histoyr