docusign在完成时更新父字段 [英] docusign update parent field on complete

查看:101
本文介绍了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中的选择列表字段,以指示文档已签名并已接收.
  1. User goes to an object A and clicks the custom button (exactly same one as in documentation) selects a template and sends to user X.
  2. The receiver X will sign and send it back. My question is - after step 3, is there any way to update a picklist field in the object A indicating that the document is signed and received.

我不想触发文档状态,并且当我尝试使用流程生成器时,看不到父选择列表字段.

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.

谢谢

KR

推荐答案

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. 公式字段将无济于事,因为DocuSign状态与Salesforce对象之间存在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;
}

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

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