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
Ashley DolanAshley Dolan 

Email Handling Before Insert

Hello,

I am looking to implement a feature that when an email is recieved on a case that has been Resolved or Closed the email creates a new case rather than linking to the original case.

I have tried a couple of things without achieving the desired results. 1) removing the case reference string from the email body/subject and removing the parent Id, 2) cloning the case.

I want the email to follow the email to case rules and assign the new case as per the rules we have set up. Any answers/suggestions would be useful.

Thanks,
Ashley
Harish DHarish D
Hi Ashley,

Unfortunately, creating a new case is not possible when an incoming reaches salesforce email-to-case address with a thread Id in Subject/Email Body

If this functionality is must then you have below options:

1) When an Email is received on a Closed a Case, create a new Case using Trigger on EmailMessage Object but you won't be able to move the Email Message from old case to new Case

2) Use Email Services which provides lot of flexibility in handling the incoming Email Messages as it requires an Apex class to handle the incoming cases and you can write all your logic in  apex class. 

Regards,
Harish
 
Ashley DolanAshley Dolan
Thanks for the response Harish,

With the second point there, are you able to force the email to case rules within the apex code, like you can use Active Assignment rules when inserting a case are you able to do this with Email Services?

Many Thanks,
Ashley