文档更新完成后的父字段 [英] docusign update parent field on complete

查看:32
本文介绍了文档更新完成后的父字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 docusign 与 Salesforce 集成的新手.我正在遵循

I am new to docusign integration with salesforce. I am following a simple flow of

  1. 用户登录到 sfdc
  1. User logs into sfdc
  1. 用户转到对象 A 并单击自定义按钮(与文档中的按钮完全相同)选择一个模板并发送给用户 X.
  2. 接收方 X 将签名并发回.我的问题是 - 在第 3 步之后,是否有任何方法可以更新对象 A 中的选项列表字段,表明文档已签署并已收到.

我不想触发文档状态,当我尝试流程构建器时,看不到父选项列表字段.

I do not want to do a trigger on document status and when I tried process builder, cannot see the parent picklist field.

所以,我想知道 docusign 是否有任何功能可以解决我的问题.

So, I want to know if docusign has any feature to solve my problem.

谢谢

韩国

推荐答案

App Exchange 上的 DocuSign for Salesforce (DfS) 应用程序是最终产品(即最终用户产品).如果当前的功能集不能解决您的所有业务需求,那么您始终可以进行 API 集成并使用 DocuSign Connect 模块.

The DocuSign for Salesforce (DfS) app on the App Exchange is an end product (ie. end-user product). If it's current feature set does not solve all of your business needs then you can always do an API integration and use the DocuSign Connect module.

使用 DocuSign Connect,您可以设置一个外部 http 侦听器,在其中发送实时状态/事件更新并可以对其进行解析.那时,您可以在 Salesforce 内部或外部编写您需要执行的任何逻辑.有关 DocuSign Connect 的更多信息,请参阅此处.

Using DocuSign Connect you can setup an external http listener where real time status/event updates are sent and can be parsed. At that point you can write whatever logic you need to do inside or out of Salesforce. For more info on DocuSign Connect see this here.

否则如果你想和DfS结合使用,这只能通过触发器来完成,因为

Otherwise if you want to use in conjunction with DfS, this can be done only by trigger because

  1. 工作流无济于事,因为工作流无法更新相关(通过查找字段)对象.
  2. 由于同样的问题(无法更新相关对象),流程构建器也无济于事.
  3. 公式字段无济于事,因为 Salesforce 对象的 DocuSign 状态是 1 对多的关系.

唯一正确的解决方案是触发器(很简单,10行代码,用你的信息替换我的TODO):

The only correct solution is a trigger (it’s very simple, 10 lines of code, just replace my TODOs with your info):

trigger UpdateOpportunityOnEnvelopeCompleted on dsfs__DocuSign_Status__c (after update)
{

    // get a set of all completed docusign statuses with opportunities
    Set<Id> opportunityId = new Set<Id>();
    for(dsfs__DocuSign_Status__c  status : Trigger.new) {
       if (status.dsfs__Opportunity__c != null && status.dsfs__Envelope_Status__c== 'Completed') {  // TODO: Replace dsfs__Opportunity__c with the object you want to update, say dsfs__Contact__c or dsfs__Lead__c
           opportunityId.add(status.dsfs__Opportunity__c);                                                                                     // TODO: Replace dsfs__Opportunity__c with the object you want to update
       }
    }

    // retrieve these opportunities
    // TODO: Replace DeliveryInstallationStatus__c with the field you want to update, replace Opportunity to your object name, ex: Contact or Lead
    List<Opportunity> opportunities = [SELECT Id, DeliveryInstallationStatus__c FROM Opportunity WHERE Id IN :opportunityId];

    // update these opportunities
    for(Opportunity o : opportunities) {                  // TODO: Replace Opportunity with your object name
        o.DeliveryInstallationStatus__c = 'Completed';    // TODO: Replace DeliveryInstallationStatus__c with the field you want to update , replace 'Completed' with field value you want to set
    }
    update opportunities;
}

这篇关于文档更新完成后的父字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆