1

When users choose to create a case from an email it does not auto populate the Account name in the Case form. It works fine if you view a customer and create a case from the detail view page but not from an email (the customer does exist with the same email address.)

Also when I view a customers details it's not showing the emails in the history, so it's obviously not linking the email with the account.

Update

Here is a code sample:

List<String> subjectParts = email.subject.split('_') Select account where name = subjectParts.get(0); List<String> servers = subjectParts.get(1).split('-'); 
Select a.Id, (Select Id, Subject From Cases where IsClosed = false AND Subject = :servers.get(0)) From Account a Create case. case.Subject = servers.get(0);
  • Please be clear.Can you explain in more depth your problem scenario? – Mohith Shrivastava Nov 8 '12 at 11:27
  • I don't see how this is related to apex? Are you using standard email to case or is this a custom functionality? – PepeFloyd Nov 8 '12 at 12:32
  • please add code samples. If you have your email2case installed on what server? is that server communicating correctly with your app? – Saariko Nov 8 '12 at 13:53
  • yeah every thing is working properly but account fiels is not populating List<String> subjectParts = email.subject.split('_') Select account where name = subjectParts.get(0); List<String> servers = subjectParts.get(1).split('-'); Select a.Id, (Select Id, Subject From Cases where IsClosed = false AND Subject = :servers.get(0)) From Account a Create case. case.Subject = servers.get(0); – – shivaram Nov 8 '12 at 14:20
  • Are you using the native Email2Case functionality or parsing emails with custom code? – Mike Chale Nov 9 '12 at 14:51
2

I can think of a few reasons why the Contact is not being attached:

  1. The email did not match any Contacts
  2. The email matched more than one Contact
  3. The email is not in the standard email field (Salesforce will not match on custom fields.)

Edit

The Account field is generally populated based on the Case's Contact; when the Contact is populated Salesforce automatically pulls in the Contact's Account. If you aren't setting the Contact lookup I suspect that is why the Account is blank.

  • When users choose to create a case from an email it does not auto populate the account name in the case form. It works fine if you view a customer and create a case from the detailview page but not from an email (Yes the customer does exist with the same email address) Also when I view a customers details it's not showing the emails in the history, so it's obviously not linking the email with the account. – shivaram Nov 8 '12 at 13:03
  • Cases to be automatically created In salesforce.com based on emails sent . These Cases will be associated with the relevant Account In salesforce.com based on the contact details of the original sender of the Email. Creating the code to parse the Email to extract Account record and create Case including child Cases. In this format AccountName_ServerInstant-AlartName this format is the subject of Email subject is from subject field from case object, and Email body is description field In case object. If subsequent emails are sent before the Case is manually closed t – shivaram Nov 8 '12 at 13:04
  • Is the Contact populated but not the Account or are both blank? Email2Case doesn't work with Accounts. – Mike Chale Nov 8 '12 at 15:15
  • both fields blank – shivaram Nov 8 '12 at 16:03
  • Your customers are in the system as Contacts, right? – Mike Chale Nov 8 '12 at 16:13
0

Most likely there is more than one contact using the same email addresss. Therefore, the account/contact are not automatically populated.

In regards to the second issue, are you sure you have added the "email" related list to the page layout.?

  • List<String> subjectParts = email.subject.split('_') Select account where name = subjectParts.get(0); List<String> servers = subjectParts.get(1).split('-'); Select a.Id, (Select Id, Subject From Cases where IsClosed = false AND Subject = :servers.get(0)) From Account a Create case. case.Subject = servers.get(0); – shivaram Nov 8 '12 at 12:45
  • need to sort out by above way – shivaram Nov 8 '12 at 12:55

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.