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
Dave WallinDave Wallin 

EmailMessage sObject

Hello team,

Currently we are trying to create a EmailMessage sObject.  It is listed within the API but we get a Unsupported object type error when trying to create one (using the partner WSDL)

We looked into using SingleEmailMessage and MassEmailMessage but these two do not meet our requirements because:
1) We do not want to send the email (just create an archive or mock email and associate it to a case or opportunity)
2) We need to be able to set the From: value of the EmailMessage

It seems as though the EmailMessage object meets all of these requirements.  Can anyone shed some light onto this issue?  Thank you.
werewolfwerewolf
The EmailMessage sObject is only exposed when an org has turned on Email To Case.  Bear in mind that EmailMessage can only be parented to Case.  For other objects, email messages are actually stored in Salesforce using the Task object.
Dave WallinDave Wallin
Ok...  Is it possible to set the From, To, CC and BCC in a task object?
werewolfwerewolf
Unfortunately not by default, although I guess you could add some custom fields to Task for that purpose.
gueropolkasgueropolkas

So you're saying that I can't set the parentId to some other object, like a contact?

 

thanks

 

Dan