You need to sign in to do that
Don't have an account?
Shaan Khokhar 9
How To Make Email-To-Case Use Subjects To Combine Them
Hi all,
We have a scenario where someone has a system that when they reply, it doesn't directly reply meaning the case thread ID is lost.
However, the system they use include there own support case number and this will be the same number, but, there subject changes after creation of the case to include 'Updated'.
I've attempted to utilize my code here inside the Apex Trigger of Email Message but it doesn't seem to be doing anything:
trigger AssociateEmail on EmailMessage (before insert) { for(EmailMessage eMsg : Trigger.new) { String json = JSON.serialize(eMsg.Subject); String jsondata = json.replaceAll('[^0-9]',''); System.debug('test'); System.debug(jsondata); List<Case> c = [select Id from Case where Subject = :jsondata LIMIT 1]; if(c.size() > 0) { eMsg.Id = c[0].Id; } } }
eMsg.ParentId = c[0].Id;