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.

2 Answers 2

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

1
  • 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, 2018 at 21:07
1

We resolved this by building a custom Status__c field on EmailMessage which mirrors the standard status field, but allows us to trigger updates to related records, etc. Our use case was the same as yours!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .