I'm after finding a way to know if a EmailMessage object has a reply?

I have tried to use Trigger after insert but I do not see its picking. Any other better way?

when the user response to email-to-case... I just need to know when/if the user has a reply

trigger hasReply on EmailMessage (before insert, after insert, after delete, after update) 
   if(trigger.isInsert) {    
      system.debug('got reply?');

1 Answer 1


From the documentation you can look for ReplyToEmailMessageId field .This field has a value if the message is a reply and also if there is a reply to your case there will be a single record in SFDC DB for EmailMessage record with ParentId field as CaseId .

You can use these fields to query back from DB or check the field values to find whether these are reply .

You must log in to answer this question.

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