You need to sign in to do that
Don't have an account?
Manish Kumar 61
Email2case not working
I wrote a trigger which is causing a side effect that email2case is not working. How do I debug this?
My code is
My code is
for (Case caseObj :Trigger.new) { if(caseObj.Origin == 'Email') { EmailMessage toEmail = [SELECT ToAddress FROM EmailMessage WHERE Incoming = true LIMIT 1]; String te = String.valueOf(toEmail); System.debug('Email To Address is ' + toEmail); caseObj.Customer_Support_Email__c = te; } }
I suspect the issue is line 4. You are trying to cast an SObjct as a string. If you replace your code with what is below, this should solve the issue: Please remember to mark this thread as solved with the answer that best helps you.
Kind Regards
Stephen
All Answers
I suspect the issue is line 4. You are trying to cast an SObjct as a string. If you replace your code with what is below, this should solve the issue: Please remember to mark this thread as solved with the answer that best helps you.
Kind Regards
Stephen