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
Chris McFarlingChris McFarling 

Update EmailMessage RelatedToId

I want to relate an outbound email message to a different Opportunity. EmailMessage.RelatedToId holds the Id of the Opportunity for which it's related to. I attempted to simply change the RelatedToId on the EmailMessage using Execute Anonymous but it doesn't work. Getting error "System.SObjectException: Field is not writeable: EmailMessage.RelatedToId".
 
EmailMessage msg=[SELECT Id, RelatedToId FROM EmailMessage WHERE Id = '02so000000I7rXuAAJ'];
msg.RelatedToId='006o000000NJzV1AAL';
Update msg;

Is there another method of updating this field?
 
David Jackson AUDavid Jackson AU
Any updates on how the RelatedToId field can be inserted
Judith DrakeJudith Drake
I did not find any update on this topic.

Thanks and Regards,
Judith J. Drake
https://www.talktowendys.website/
amelia pearlamelia pearl
EmailMessage is only available for organizations that use Email-to-Case or Enhanced Email, which is automatically enabled for most  talktowendys (https://www.talktowendys.today/)
ravindar shahravindar shah
I also not find any update on this topic
thanks and regards,
https://www.downloadeaadhar.online