Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Make your voice heard. Take the 2019 Developer Survey now

Questions tagged [emailmessage]

The tag has no usage guidance.

0
votes
0answers
13 views

Test Email-to-Case with mass emails and EMailMessage trigger

We are working on an org where cases are generated via Email-to-Case and a trigger on EmailMessage is carrying out some processes. A batch job then in a 5 minute rhythm works on these generated cases ...
0
votes
0answers
8 views

Pushtopic for streaming api

I am currently trying to set up a stream api for email message. The problem I am currently having is that Pushtopics do not support email message(that I know of). Does anyone know of a work aound for ...
0
votes
1answer
28 views

“Reply All” , “Reply” and “Forward” buttons not visible in the Send Email Activity on an Apex generated email

I have an Email Service with an Apex class that creates a new EmailMessage object associating the sender with a Contact in the system and the recipient as a User. The email shows up correctly with all ...
2
votes
0answers
32 views

Migrating Email Messages from one salesforce org to another salesforce org

I exported EmailMessages and EmailMessageRelation from Source org and Imported it to Target Org. Lead Layout (Source Org) - I can see 2 related list 1. Activity History(when clicked opens outbound ...
2
votes
0answers
50 views

HtmlBody of on EmailMessage does not stay as set in before insert trigger

I'm trying to cut off email threading from EmailMessage. I try to do this in BEFORE INSERT trigger. Original email: Hello Tom, We saw your complaint. We are working on it. Gigasoft ...
1
vote
1answer
26 views

How to query contentversion to Email Message

We have integrated Salesfroce and our Support Page, and I have to send emailmessage via rest api along with attachment lies within the email, but I don't find a relateionship between Contentversion ...
0
votes
2answers
24 views

RelatedTo field of Email message

RelatedTo field has multiple lookups to various object for my instance its heavily populated as follows: Lookup(Contract,Campaign,Organization,Donation,Product,Asset,Case,Solution,Asset ...
0
votes
2answers
24 views

What happens when I delete the Task related to an EmailMessage?

We're looking for ways to get rid of some data in several orgs. One potential target would be the Task records that get created along with every EmailMessage. (I.e. the Tasks of which the Id is stored ...
1
vote
0answers
23 views

Understanding EmailMessage for Data Migration

As I attempt data migration from one Salesforce org to another, I am finding EmailMessage to be a very unnecessarily complicated object to understand. At one point I thought I understood that recent ...
-1
votes
0answers
19 views

Need to Track actual Response TextBody on Reply Email instead of whole Email Thread on Reply email

In the Above Feed Body , I need to get , Actual Response replied by the Customer in Email to Case Here I need to Restrict Other Content in Email except Actual Customer Comment This is Because , It is ...
0
votes
0answers
29 views

EmailMessage object - multiple RelatedToId references

Within the documentation for EmailMessage object it reads: The RelatedToId represents nonhuman objects such as accounts, opportunities, campaigns, cases, or custom objects (emphasis mine) ...
1
vote
2answers
59 views

Sharing settings on accounts, cases, emails and attachments

We have a requirement in which we need to make some accounts private. We do this by flagging the account with a deleted field. This flag is used in our sharing settings. We are using the exact same ...
0
votes
0answers
44 views

Problem regarding view permissions on EmailMessage Object for records with empty EmailMessage.relatedToId

We created a custom email service in order to sort incoming emails to opportunities. If an opportunity-id/-name cannot be identified, we save the EmailMessage, but dont set the field relatedToId. ...
1
vote
1answer
90 views

In email coming from salesforce what is X-SFDC-EmailCategory

I would like to know what this statement means. X-SFDC-EmailCategory: caseCommentNotification
2
votes
0answers
242 views

How to create an EmailMessage record with DML having HasAttachment to be 'true'?

I'm creating EmailMessage records via DML EmailMessage createWhatEmail = new EmailMessage( Subject = 'test' ,Status = '3' ,ToAddress = 'heim@...
7
votes
1answer
252 views

How to get the Id of an EmailMessage after sending a SingleEmailMessage with Messaging.SendEmail()?

Is there any way to easily retrieve the Id of EmailMessage records after sending them via Messaging.SendEmail()? Messaging.SingleEmailMessage m = new Messaging.SingleEmailMessage(); m.setToAddresses( ...
14
votes
1answer
326 views

How to use an Apex Email Service to store emails on a record EXACTLY as Salesforce does?

I have used the Lightning Experience UI to send an Email from a Record Homepage via Activity-Tab. This looks like this (bottom-right!): Now I want (vice versa) to store an incoming email received by ...
3
votes
3answers
399 views

Different between RelatedToId vs ParentId In EmailMessage

I had task related to Email Message (email-to-case). When an email arrives on closed case object, Then i was have to clone the old case object & create new record on that with exact data and also ...
0
votes
1answer
46 views

“does not have an accessible email address.” - Error message when adding EmailMessageRelation

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 ...
0
votes
0answers
59 views

Cannot query on IsPrivateDraft field of EmailMessage

I have a field named IsPrivateDraft in EmailMessage, I want to use that field for updating the draft EmailMessage. I want to know the value of this field but cannot use it in query. On using the field ...
0
votes
0answers
15 views

Unable to update case comments from email message

In my organization we set up email-to-case. Now when they sent emails from sfdc I need to update case comments. I wrote a trigger on email message object and updating case comments. But the problem ...
1
vote
2answers
409 views

How to send email alert as email-to-case when case is closed?

I am able to send email alert when case is closed. But the email alert NOT showing in email messages at case related list: The email when case closed is marked as 'CASE CLOSED' in email subject: ...
0
votes
1answer
60 views

Outbound SingleEmailMessage doesn't attach as EmailMessage on Case

I have a custom list button on case that processes the selected case records and sends out an email using SingleEmailMessage. The email sends fine, but I was expecting the outbound email to be related ...
0
votes
0answers
66 views

Inbound Email Message getting Insufficient access error for Opportunity Owner

I have written an Inbound email service to capture email and store it under an Opportunity. This is working as expected. However, when ever I insert an EmailMessage record, an Activity- Task is also ...
0
votes
0answers
133 views

Copying attachments from Outbound Email to parent case

I have two scenarios to copy attachments to Case files. Scenario1: When a user sends a Email-to-Case, then any attachments present in the email should be copied over to Case Files. I have apex code ...
1
vote
0answers
74 views

Email send through apex trigger are not showing in case feed at case console

I am sending an email message to the case contact after creating the case. I am sending this Email through apex trigger.But this email message is not shown in console case feed. I am sending another ...
3
votes
1answer
151 views

How can I know if a case has unread emails?

I've been thinking about using the "Status" field on EmailMessage for this. However I noticed that when the user accesses the email page the record has its status updated from 0 to 1 (unread to read), ...
0
votes
1answer
336 views

Can I edit the TextBody of EmailMessage object when registering a case from Email-to-Case?

Can I write a 'after insert' trigger on EmailMessage object to edit the TextBody of incoming Mail? Is it possible in Salesforce?
0
votes
1answer
157 views

How does ContentDocument/ContenVersion relates to EmailMessage?

I need to get attachments when trigger on EmailMessage executes. How do I find them? Edit: The EmailMessage is created via Lightning for Outlook plugin.
1
vote
0answers
394 views

Trigger on EmailMessage to update related Case is actually creating new case

Below is what I am trying to do - migrating users from one org to another as a part of this "email to case" will be migrated as well open cases from "old org" will be migrated to "new org" with ...
3
votes
2answers
1k views

System.LimitException: Too many SOQL queries: 101

I am calling sendemail() from visualforce.There are no SOQL Queries inside for loops but am getting error in controller. If I comment below two lines then am not getting error Messaging....
0
votes
0answers
43 views

Connect an email on Opp to a Contact

I have 2 questions: 1) I am writing an email service apex class which creates an email on Opportunity as an activity and attaches files to it. I need this email to be related to contacts from the ...
0
votes
3answers
365 views

Trigger on EmailMessage - How to loop over incoming emails?

I have wrote a trigger that runs on EmailMessage and I could use your help to configure it. my problem is as follows: When a user sends an email to us (to Salesforce) it opens a case and the user ...
2
votes
2answers
232 views

How to save EmailMessage after sending and relate to any object and show in activity history

I've made several attempts to save an email message to be saved into the Activity history of opportunity. I have a vf page which has a form to send an email. I can send the email but not able to ...
0
votes
0answers
55 views

Why cloning of email thread in Case didn't work with Lightning

Can someone help us. We are wondering why cloning of email thread from one case to another didn't work in Lightning. But it works well with Salesforce classic. In lightning it give us an error. ...
-4
votes
1answer
126 views

System.NullPointerException: Attempt to de-reference a null object: () [closed]

I'm getting the error at line 12 i.e List{attachment} attachmentsToInsert = new List{Attachment}(); Could someone help, please? I've enabled the enhance email. Error message: Apex trigger ...
1
vote
0answers
37 views

when case is queue user cannot send email

i am trying to restrict send email from trigger on emailMessage object when case assign to queue but its throw an error in my class Invalid field RelatedToId for SObject EmailMessage public static ...
1
vote
2answers
97 views

Importing emails in a specific order using the rest API

In a data migration context from a Salesforce organization to another one, a requirement we have is to transfer the 'EmailMessage' from an organization to another. As they are the main interaction ...
1
vote
1answer
115 views

Inserted EmailMessage always “Outbound”?

We have an inbound Email handler that currently just creates a Task. I'd like to update it to create an EmailMessage object instead. However I've noticed that when viewing the Apex-inserted object in ...
0
votes
0answers
269 views

More than 384000 chracters in the email html body

I have a record in my org for email which has html body greater than 384000 charters, when I manually copy this html body and paste in a new email then it gives error for not exceeding the body limit. ...
0
votes
1answer
1k views

string_too_long html body data value too large, email message salesforce

While creating a record for email message using apex, an error is be generated ERROR string_too_long html body data value too large and the record for email message is not inserted. After ...
1
vote
1answer
613 views

SaveAsActivity is not allowed with whatId that is not supported as a task whatId

While trying to create a custom business rule using Apex I got the error: INVALID_ID_FIELD, SaveAsActivity is not allowed with whatId that is not supported as a task whatId. ...and found out that it ...
2
votes
0answers
171 views

Trigger to replace HtmlBody on EmailMessage being overwritten by native SF logic?

We have written a trigger on the EmailMessage object that searches the HtmlBody of any newly inserted record for a static String. If found, Everything from the index of this string to the end of the ...
0
votes
2answers
1k views

How to mass delete EmailMessage?

I'm have a system administrator profile and I can't delete all the email messages (EmailMessage object) on my organization. What can I do? I've tried running Apex queries with the delete statement and ...
0
votes
2answers
80 views

Trigger to copy Case Description to Rich Text custom field - upon first incoming EmailMessage

I have the below trigger on Case, which helps in copying the incoming EmailMessage to a custom field (of type Rich Text), so we can have an 'HTML' Case Description, rather then the out-of-the-box text ...
1
vote
2answers
406 views

EmailMessage Status is not changed to “Read”

I have enabled email-to-case functionality and I have a user with Partner Community license. He works on Partner Portal. When he opens an e-mail through the Partner Portal its status is not updated to ...
5
votes
1answer
1k views

EmailMessage query returns 'No such column'

I am trying to query emailMessage objects related to a custom object. When I try the query in the Developer console query editor it returns results, also works in workbench. However when I use the ...
1
vote
0answers
42 views

Push Email to Unresolved Items(Emails) [closed]

I have an issue with pushing EmailMessage to Unresolved Items(Emails) in Apex. I use custom Email Service(not My Email to Salesforce) and have my custom logic for incoming email in Apex class. What ...
2
votes
2answers
186 views

Find EmailTemplate Used in EmailMessage

Is there a way to find out if/what emailTemplate was used on an outbound EmailMessage? Looking in Eclipse I cannot see any relationship between the two (or in the schema builder tool), nor a field on ...
1
vote
1answer
47 views

How to create a vf page as same as standard email send page

I need to create a vf page exactly like in this image. Everything , should be there including the lookup property of the fields. But when i tried creating , bcc address and cc address are text only(...