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), but the trigger on the Email Message object isn’t run.

Is there a way to distinguish cases with unread emails from the ones with all messages read?

Answer

Best solution I’ve seen so far is a scheduled apex class that just goes through all cases and updates status rather than relying on a trigger.

Attribution
Source : Link , Question Author : Renato Oliveira , Answer Author : smohyee

Leave a Comment