I’m writing a Windows service that will poll my IMAP4 inbox for emails from clients and create new Cases in Salesforce based on them.
Sometimes emails come in with a Case reference code in the subject. Ex: “[ ref:00FFwxyz.500FFJJS5:ref ]”. I’d like to assign such emails to the existing Case identified by the code rather than create a new one.
My questions is: Is there a definitive formula for extracting a unique Case identifier from the ref code? I’ve seen a few formulas that do the reverse, but they all look like guesswork: Blog post on KnowThyCloud.com, Force.com Discussion Board thread.
Found a decent enough solution. I was wrong in calling the post on KnowThyCloud.com guesswork. In the right context it works fine.
My solution is to create a new custom field on the Case record of type “Formula (Text)”. The field’s value is the formula mentioned in the blog post:
Now the value of the custom field for each Case record is the same as the reference Id in emails and I can simply query for it with the Salesforce API.