I'm trying to associate a Contact to a EmailMessage object using the EmailMessageRelation object, this issue is that I have many email fields on my Contact object and if I related to a Contact that doesn't have a email address in the default "Email" field, I'll get an error like;

[{"message":"<CONTACT RECORD NAME HERE> does not have an accessible email address.","errorCode":"INVALID_EMAIL_ADDRESS","fields":["ToAddress"]}]

I can't find anything for this error message or anything to suggest when relating an EmailMessage the record needs to have a value in the default email field.


Because it is associating to a standard Salesforce object I think there is an inbuilt assumption that you would use the standard field.

Some options:

  1. Before send, push the correct email address to the standard email field and clear it post send.
  2. Use the RelationAddress field instead and simply push the address in there.
  • Yeah, I feel you're correct about the assumption but was looking for clarification on this as I'm trying to add the EmailMessage manually. Not being able to relate to Contacts/Leads that use custom email fields creates a rather large restriction of using this object to represent emails. – r0bb077 Jul 8 '18 at 6:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.