完成后 docusign 更新父字段
docusign update parent field on complete
我不熟悉 docusign 与 salesforce 的集成。我正在遵循
的简单流程
- 用户登录 sfdc
- 用户转到对象 A 并单击自定义按钮(与文档中的按钮完全相同)选择模板并发送给用户 X。
- 收件人X签收寄回。
我的问题是 - 在第 3 步之后,是否有任何方法可以更新对象 A 中的选择列表字段,指示文档已签名并收到。
我不想触发文档状态,当我尝试进程构建器时,看不到父选项列表字段。
所以,我想知道 docusign 是否有任何功能可以解决我的问题。
谢谢
韩国
App Exchange 上的 DocuSign for Salesforce (DfS) 应用程序是最终产品(即最终用户产品)。如果它的当前功能集不能解决您的所有业务需求,那么您始终可以进行 API 集成并使用 DocuSign Connect
模块。
使用 DocuSign Connect,您可以设置一个外部 http 侦听器,其中实时 status/event 更新被发送并可以被解析。届时,您可以在 Salesforce 内部或外部编写您需要执行的任何逻辑。有关 DocuSign Connect 的更多信息,请参阅此 here。
否则如果你想和DfS一起使用,这只能通过触发器来完成,因为
- 工作流无济于事,因为工作流无法更新相关(通过查找字段)对象。
- Process builder 也不会因为同样的问题提供帮助(无法更新相关对象)。
- 公式字段无济于事,因为 DocuSign 状态与 Salesforce 对象是一对多关系。
唯一正确的解决方案是触发器(非常简单,10 行代码,只需将我的 TODO 替换为您的信息即可):
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 与 salesforce 的集成。我正在遵循
的简单流程- 用户登录 sfdc
- 用户转到对象 A 并单击自定义按钮(与文档中的按钮完全相同)选择模板并发送给用户 X。
- 收件人X签收寄回。 我的问题是 - 在第 3 步之后,是否有任何方法可以更新对象 A 中的选择列表字段,指示文档已签名并收到。
我不想触发文档状态,当我尝试进程构建器时,看不到父选项列表字段。
所以,我想知道 docusign 是否有任何功能可以解决我的问题。
谢谢
韩国
App Exchange 上的 DocuSign for Salesforce (DfS) 应用程序是最终产品(即最终用户产品)。如果它的当前功能集不能解决您的所有业务需求,那么您始终可以进行 API 集成并使用 DocuSign Connect
模块。
使用 DocuSign Connect,您可以设置一个外部 http 侦听器,其中实时 status/event 更新被发送并可以被解析。届时,您可以在 Salesforce 内部或外部编写您需要执行的任何逻辑。有关 DocuSign Connect 的更多信息,请参阅此 here。
否则如果你想和DfS一起使用,这只能通过触发器来完成,因为
- 工作流无济于事,因为工作流无法更新相关(通过查找字段)对象。
- Process builder 也不会因为同样的问题提供帮助(无法更新相关对象)。
- 公式字段无济于事,因为 DocuSign 状态与 Salesforce 对象是一对多关系。
唯一正确的解决方案是触发器(非常简单,10 行代码,只需将我的 TODO 替换为您的信息即可):
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;
}