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.
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);