1

EmailMessages have a Status field that will automatically update from 'New' to 'Read' when you open the email record from the Case.

I'd like to update a Case 'Email Status' field to make it easy to tell from a Case List View whether there's a new unread email on a case.

However, the change to the Email's status field doesn't fire workflows or triggers on the EmailMessage Object!

Anyone have a good solution to this? Best I can come up with is scheduled batch apex to just update all cases with their most recent emailmessage's status.. but given the frequency of cases and emails this would have to be running near constantly to be reliable.

1

Currently it is not possible to detect status change from New to Read. Here is an idea https://success.salesforce.com/ideaView?id=08730000000biKgAAI

Here is the workaround: Cannot get Workflow/Trigger to identify Read Email on Case object

An alternative to consider is to use a VF page as an element within your standard Case page layout.

  • The VF page is associated to a controller with access to the Case id
  • The controller can query the children of the Case (that is, EmailMessage)
  • The controller can thus display on the VF page a message indicating an unread EmailMessage (and links too)

Downsides?

If you need to use SFDC reports to report on Cases w/ unread emails (or List Views) - these won't work

| improve this answer | |
  • Thanks for sharing that solution! I had thought of using a VF page for the Case list view, but a blank vf component would allow me to use apex in the controller without having to design a new UI. – smohyee Jul 25 '18 at 21:07

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.