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
Wahid BuhariWahid Buhari 

email to case - updating case fields from email

I am using email-to-case functionality to create cases from emails. I have used a custom field say mail_body__c(rich text area) to store email body and updating the field using trigger. this is working fine. Now my requirement is to store all incoming emails(from customers) related to a particular case in the custom field mail_body__c. How can I acheive that? Any help on this would be highly appreciated. Thanks.
Best Answer chosen by Wahid Buhari
RKSalesforceRKSalesforce
Hi Wahid,

​I hope we would be able to achieve this by using trigger on Email Message object. after insert of your email query the case using Parent field of your Email Message and just update the mail_body__c field .
Update should be like : mail_body__c = mail_body__c + your Email Message body field. To distinguish between Email Messages you can use New Line charactes or some date field.

Please let me know if helped.

Regards,
Ramakant

All Answers

RKSalesforceRKSalesforce
Hi Wahid,

​I hope we would be able to achieve this by using trigger on Email Message object. after insert of your email query the case using Parent field of your Email Message and just update the mail_body__c field .
Update should be like : mail_body__c = mail_body__c + your Email Message body field. To distinguish between Email Messages you can use New Line charactes or some date field.

Please let me know if helped.

Regards,
Ramakant
This was selected as the best answer
Wahid BuhariWahid Buhari
Hi Ramakant,

Thanks for the update. This should work. Will try this and let you know .
RKSalesforceRKSalesforce
Hi Wahid,

If this is worked Please mark it as Best Answer.

Regards,
Ramakant
ajith kumar 35ajith kumar 35
Hi Wahid Buhari,

I need your help whil creating email-to-case i need to store the first email description to be stored in custom rich text field. I tried process builder,workflow and trigger too still I cont able to achive please help....!   Thanks in advance