简体   繁体   English

如何使用来自外部服务的数据更新新联系人?

[英]How do you update a new contact with data from an external service?

I am using Salesforce Lightning mode and looking to use the configure not code approach.我正在使用 Salesforce Lightning 模式并希望使用配置而非代码方法。 I have an external service defined.我定义了一个外部服务。

The scenario I am trying to implment is as follows:我试图实现的场景如下:

  1. User Creates Contact in Salesforce用户在 Salesforce 中创建联系人
  2. Automatically invoke external web service with some data from the new Contact使用来自新联系人的一些数据自动调用外部 Web 服务
  3. Retrieve relevant data from the external service从外部服务中检索相关数据
  4. Update the contact with the data用数据更新联系人

My first attempt was to create a Record-Triggered Flow that was activated when a new Contact entity was created.我的第一次尝试是创建一个记录触发流,该流在创建新联系人实体时被激活。 The flow was then able to assign relevant variables before triggering an Action which invoked my external service.然后,流程能够在触发调用我的外部服务的操作之前分配相关变量。 The problem I had with this is that the error "'You have uncommitted work pending. Please commit or rollback before calling out' error" appeared which led me to this article: https://help.salesforce.com/articleView?id=000328873&type=1&mode=1我遇到的问题是出现错误“'你有未提交的工作挂起。请在调用之前提交或回滚'错误”导致我看到这篇文章: https : //help.salesforce.com/articleView?id= 000328873&type=1&mode=1

So the problem as I understood it was that I cannot invoke an external service in a flow that is triggered by a contact creation.因此,据我所知,问题是我无法在由联系人创建触发的流中调用外部服务。

ok好的

So then I looked at creating a Process which would invoke a Flow.然后我看着创建一个流程来调用流程。 The process is one that starts "When a record changes" and that record is set to be a Contact record that is created.该过程是一个开始“当记录更改时”并将该记录设置为创建的联系人记录的过程。 The process then is supposed to call my Flow which will do the actual external service invocation.然后该流程应该调用我的 Flow,它将执行实际的外部服务调用。

  1. Am I on the correct lines with this approach?我使用这种方法是否正确?
  2. How do I pass variable information to the Flow from the Process?如何将变量信息从流程传递到流程?

Thanks for any insight感谢您的任何见解

The limitation is there because you're making a new record = you're temporarily locking the database table (or maybe not whole table, maybe just 1 row).存在限制是因为您正在创建一条新记录 = 您正在临时锁定数据库表(或者可能不是整个表,可能只是 1 行)。 But you can't hold the database hostage, have the operation wait up to 120 seconds until it succeeds/fails/timeouts.但是您不能劫持数据库,让操作等待最多 120 秒,直到成功/失败/超时。 External system call must be independent, asynchronous operation.外部系统调用必须是独立的、异步的操作。

In process builder there are immediate and time-based actions.在流程构建器中,有即时和基于时间的操作。 Try to put your flow in time-based, even if it'll be set to 0 minutes after the contact creation.尝试将您的流程置于基于时间的状态,即使在创建联系人后将其设置为 0 分钟。 Or maybe in flows there are also ways to do similar thing, been a while since I used them for serious stuff.或者也许在流程中也有做类似事情的方法,自从我将它们用于严肃的事情以来已经有一段时间了。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 SalesforceIQ / RelateIQ API:如何为外部用户创建联系人(OAuth?) - SalesforceIQ/RelateIQ API: how do I create a contact for external users (OAuth?) Apex触发器从自定义对象更新联系人 - Apex Trigger to Update Contact from Custom Object SalesForce,如何使用另一个obj的数据更新一个对象上的字段? - SalesForce, How do I update a field on one object from using data from another obj? 如果现有记录然后根据您更新某些字段,如何在帐户对象上编写触发器,否则创建新记录? - how to write a trigger on account object if the existing record then update some fields accordoing to you else create a new Records? Apex Batch Class从自定义对象字段更新联系人字段 - Apex Batch Class to update Contact field from custom object field 每次创建新案例时,APEX 触发器都会使用案例编号更新联系人字段 - APEX Trigger to Update Contact Field with Case Number every time new Case is Created 如何将出站邮件连接到外部Web服务 - how to connect outbound message to external web service 是否可以创建将新数据作为潜在客户提交给salesforce.com的弹性联系表单? - Is it possible to create a flex contact form that submits data to salesforce.com as a new lead? 如何从Apex中的触发器更新类变量? - How do I update a class variable from a trigger in Apex? 如何使https服务本地部署以从Internet服务接收数据 - How to make https service deployed locally to receive data from internet service
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM