本文介绍了Salesforce的API:如何从电子邮件参考code标识案(" [参考:...:参考]")?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在写一个Windows服务,将轮询我的收件箱IMAP4来自客户端的电子邮件,并创建一个基于他们在Salesforce新病例。

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.

有时电子邮件进来,并在主题为例参考code。例如:[参考:00FFwxyz.500FFJJS5:参考]。我想这样的电子邮件,被分配到了code标识现有案例,而不是创建一个新的。

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.

我的问题是:有没有从裁判code提取独特的案例标识明确的公式我见过几个公式反过来做,但他们都会是什么样子?猜测:博客上KnowThyCloud.com ,<一个职位href=\"http://boards.developerforce.com/t5/Apex-$c$c-Development/Trigger-access-ThreadID-in-SOQL/m-p/76089\"相对=nofollow> Force.com讨论板线程。

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.

推荐答案

找到一个足够体面的解决方案。我呼吁上KnowThyCloud.com 猜测职。在正确的情况下正常工作。

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:

TRIM(" [ ref:" + LEFT( $Organization.Id, 4) + RIGHT($Organization.Id, 4) +"."+ LEFT( Id, 4) + SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(Id, RIGHT( Id, 4), ""), LEFT( Id, 4), ""), "0", "") + RIGHT( Id, 4) + ":ref ] ")

现在对于每个个案记录的自定义字段的值是相同的电子邮件中的引用ID,我可以简单地用Salesforce的API查询它。

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.

这篇关于Salesforce的API:如何从电子邮件参考code标识案(&QUOT; [参考:...:参考]&QUOT;)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-15 06:54