3

I have a email-to-case which shared the Record type from other group. I need to itendify the cases which is specifically created for our team and populate the some field values.

for alternative solution, we can use email services

but Is there a way to identify the new case originated from which email to case?

Thanks in advance.

3

If you need/want a configuration only solution (no apex), you can do you this. Define a specific case origin for each of you E2C addresses, and set then on the emails as appropriate. For example "Email-Support" or "Email-Info". To prevent your users from accidently selecting these sources, create a validation rule that only allows your default case creator to use your special origins.

4

If you can differentiate the types of cases via which email address the email was sent to, you could query the EmailMessage object to figure this out.

Let's say the cases you're interested in are all sent to yourteam@company.com. Then something like this in your case insert trigger should work:

Case theCase = Trigger.New[0];
EmailMessage msg = [select Id, ToAddress
                    from EmailMessage
                    where ParentId = :theCase.Id
                    limit 1][0];
if ( msg.ToAddress == 'yourteam@company.com' ) {
  updateFieldsForYourTeam(theCase);
}

You will need to make this code bulk safe, but hopefully it should give you an idea of where to start looking.

  • JLiljegren__c your answer is also useful, but now i prefer no apex approch now. Thanks :) – gold Oct 18 '13 at 3:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.