You need to sign in to do that
Don't have an account?
Reassign activities to accounts from leads
I want to assign activities related list From lead to Accounts without converting the leads.The trigger runs when the Value in a custom field 'auction access id' matches the value of the same field on acount object.The part of the code that reassigns activities is as follows:
for(Account actts : mapOfAccounts.values()){
if(ActivityHistoryMap.containsKey(actts.auction_access_Id__c)){
for(ActivityHistory ah :ActivityHistoryMap.get(actts.auction_access_Id__c)){
ah.WhoID = null ;
ah.WhatID = actts.Id ;
}
}
however i get this error: : Compile Error: Field is not writeable: ActivityHistory.WhoId
please help on how to reassign activities using this code or another that would do the job.
Thanks
You need to run your updates through the list of Events or Tasks.
http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_activityhistory.htm