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
\dev\null\dev\null 

Email to case trigger

New to Salesforce so I'm sorry if this is a dumb question. But I'm trying to write a trigger to help set some required fields on our Case object when we receive an email using email to case. I just can't understand why the trigger isn't firing in my debug logs.
 
trigger TestEmail2Case on EmailMessage (before insert, before update) {
    for(EmailMessage e : trigger.new) {
        system.debug(LoggingLevel.INFO, '>>>>> email:' + e);
    }		
}

​I've read a couple other instances of people using the before insert on email message to help tie into email to case but it just doesn't seem to be firing for me. Any help would be apprecited. Thanks!
Best Answer chosen by \dev\null
\dev\null\dev\null
I ended up moving this discussion to SE

http://salesforce.stackexchange.com/questions/103106/email-2-case-trigger

All Answers

\dev\null\dev\null
I realized after posting i can make this code even simpler.
 
trigger TestEmail2Case on EmailMessage (before insert, before update) {
    system.debug(LoggingLevel.INFO, 'omg');		
}

Still doesn't fire in my debug logs.
\dev\null\dev\null
I ended up moving this discussion to SE

http://salesforce.stackexchange.com/questions/103106/email-2-case-trigger
This was selected as the best answer
Vishwajeet PandeyVishwajeet Pandey
After Case created throught Email to case. Just check who is the CreatedBy In Case record page. Then you can set the debug log for the same user.It will be Working.