20

我想在 Salesforce 中创建新潜在客户时收到通知。Salesforce 中是否有类似 webhook 的东西或其他方式来实现这一点?

4

5 回答 5

23

是的,有很多选择:)

对于 Salesforce 作为参与者:

  1. 将在插入潜在客户时触发并向您发送电子邮件(或者如果它用于系统集成 -出站消息)的工作流规则。
  2. 您始终可以编写“插入后”Apex 触发器并在其中调用外部系统(支持 SOAP 和 RESTful API)。尽管您需要@future 注释,因为默认情况下触发器不应该发送标注(数据库提交/回滚不应该取决于外部系统是否接受了消息)。

对于作为参与者的外部系统:

  1. 每隔一段时间简单地轮询一次,比如[SELECT Id FROM Lead WHERE CreatedDate > :lastTimeIhaveChecked]
  2. 或者最近添加了一个叫做Streaming API的东西。基本上,您定义了一个 PushTopic(您感兴趣的查询)。Salesforce 会查看它返回的当前结果,每当结果发生变化时,您都会收到通知。我还没有玩过它,但从文档看来,您可以设置事件类型以仅显示“创建”事件。这可能最接近 webhook
于 2012-10-29T15:12:37.417 回答
11

我讨厌自我推销,但因为有些人可能会认为这是一个有用的答案......我为 Salesforce 构建了一个 Webhook 创建者。它是开源的:https ://github.com/jamesward/salesforce-webhook-creator

于 2014-06-30T22:11:57.090 回答
1

这通常涉及编写自己的代码来“订阅”事件、构造消息并将其发送到外部端点。我在http://beachmonks.com/posts/integrations/salesforce/practical-guide.html上写了很多关于这个主题的文章。源代码位于:http: //github.com/beachmonks/choir-salesforce

于 2014-03-19T07:52:22.110 回答
1

Salesforce does support webhooks, but they are just called by a different name - Callouts.

Here's a link to the Developer documentation on the topic:

Invoking Callouts Using Apex

Here's a description of the feature taken directly from the link above:

An Apex callout enables you to tightly integrate your Apex with an external service by making a call to an external Web service or sending a HTTP request from Apex code and then receiving the response. Apex provides integration with Web services that utilize SOAP and WSDL, or HTTP services (RESTful services).

(emphasis added)

This is basically a webhook, commonly defined as "a user-defined callback over HTTP" 2

于 2016-06-24T04:28:41.160 回答
0

还有另一种方法。使用 RoundRobin 逻辑分配新的传入线索。然后创建一个新的 WF 规则,将通知发送给新所有者和管理员或其他任何想要收到通知的人。

于 2015-05-22T02:24:11.237 回答