You need to sign in to do that
Don't have an account?

Blank Email Subject Line on Incoming Emails
I am working on setting up a trigger for incoming emails that create cases. I need to check if the email subject field is blank or "null" and put a placeholder text within the incoming email subject line that will then be the case subject line and will have case SLA's tied to those cases.
I have tried this Apex before trigger:
I have tried this Apex before trigger:
trigger AssociateEmail on EmailMessage (before insert) {
for(EmailMessage eMsg : Trigger.new) {
if(eMsg.Incoming && (eMsg.subject == '' || eMsg.subject == null)){
eMsg.subject = 'Add your subject here';
}
}
}
But this has not placed a placeholder subject on the case and I still have no SLA's tied to the case when no case subject line is set.
What am I missing to accomplish this?
You need to write a trigger on case object. try with below.
If this helps, Please mark it as best answer.
thanks!!
Thanks for the reply, if I am getting a compile error trigger name exists on a different sObject. Would this mean I need to tie a different trigger or object to the code?
Thanks
Make sure you need to write trigger on case object.
If this helps, Please mark it as best answer.
Thanks!!