Requirement : A case is created from Email to Case when a customer orders the Item. Now the user in salesforce works on it get the data and saves in an excel sheet and generates a Number say Serial Number from Excel and dispatches the Related items along with the Serial Number. One case can have upto 10 Serial Number.Later the customer sends the feedback of the ordered item to Email with the serial Number. These all causes a bit manual work and need to Reduce this

WorkAround : Created a Lookup Object Serial Number to case where name generates an autoNumber and can have upto 10 Numbers for 1 case. A field is created with Picklist and when the Customer sends the feedback this picklist value should be "Returned". When all the Status field related to Case is Returned then the case will be closed

Challenge : How can I have connection between the two cases.

Case1 when the customer order the item(it may consists 10items at 1 go)

Case2 when the customer sends the feedback with the Serial Number(In this case again a new case is being created in salesforce). I guess someone would have came across this situation and love to hear the solution

1 Answer 1


So case comments and communication happens via a specific id present in Email Subject. Its called as (Case Thread ID).

Whenever communication happens having case threadID in subject it gets logged in Salesforce.

What you can do is, whenever you send feedback mail, make sure you include case_thread_id in it, so it can be logged in into the appropriate case.

Other option is Writing your own Inbound Email Service(My Preference).

Apex Email service allows you to parse the email body and subject and then use your Apex code to decide what you want to do.

SRC: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_email_inbound_what_is.htm

  • 1
    The "thread Id" may be in the subject or body, to be pedantic. It's probably better to place a thread Id in the body, because it's less likely to be truncated by mail programs.
    – sfdcfox
    Mar 22, 2018 at 16:25
  • Agreed, Should be in the body. Probably hidden via CSS so someone tries changing it. Mar 22, 2018 at 16:26
  • I was little late with the reply. Trying with Apex Email Service, once done will let you know the output
    – Eagerin Sf
    Mar 27, 2018 at 3:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .