简体   繁体   English

Salesforce:用机会所有者的经理自动填充DocuSign收件人

[英]Salesforce: Auto-populate DocuSign recipient with the opportunity owner's manager

I am working on a button logic on my opportunity layout for docusign for salesforce. 我正在为docusign for salesforce建立机会布局上的按钮逻辑。 It is pretty basic, and I just need 这很基本,我只需要

  • My template to be selected 我要选择的模板

  • My commercial contact to be set as the first recipient on my template 我的商业联系人将被设置为模板上的第一位收件人

  • the manager of my opportunity owner to be set as the second recipient on my template 我的机会所有者的经理将被设置为模板上的第二个收件人

  • The opportunity owner to be set as the third recipient 机会所有者将被设置为第三个收件人

My template has 3 pre-defined roles called "client signer"=signer 1, "company siner"= signer 2; 我的模板具有3个预定义角色,分别是“客户签名者” =签名者1,“公司犯罪者” =签名者2; and a carbon copy recipient (my opportunity owner). 和抄本的收件人(我的机会所有者)。 To make things easier; 使事情变得容易 I created formula fields on the opportunity layout that pull the email and name info. 我在商机布局上创建了公式字段,用于提取电子邮件和姓名信息。 They all show up fine on the URL I generate; 它们都可以很好地显示在我生成的URL上; but only the client signer is shown as a recipient on the interface 但只有客户端签名者在界面上显示为收件人

I have tried countless time to apply what was on the guide; 我尝试了无数时间来应用指南中的内容。 but only my first contact role seems to populate. 但似乎只有我的第一个联络人。 Here is what I have now. 这就是我现在所拥有的。 I tried to play around with the CRL, CCTM etc.. but it did not work yet 我尝试使用CRL,CCTM等。但是它仍然没有用

{!REQUIRESCRIPT("/apex/dsfs__DocuSign_JavaScript")} 

//********* Option Declarations (Do not modify )*********// 
var RC = '';var RSL='';var RSRO='';var RROS='';var CCRM='';
var CCTM='';var CCNM='';var CRCL=''; var CRL='';var OCO='';
var DST='';var LA='';var CEM='';var CES='';var STB='';
var SSB='';var SES='';var SEM='';var SRS='';var SCS ='';var RES=''; 
//*************************************************// 

//Adding Notes & Attachments 
var LA='0'; 

//Custom Recipient Contact List 
var CRL='Email~{!Opportunity.Client_Signer_Email_crm__c};
FullName~{!Opportunity.Client_Signer_Full_Name__c}; 
RoutingOrder~1; 
Email~{!Opportunity.Customer_Signer_Email_crm__c}; 
FullName~{!Opportunity.Customer_Signer_Full_Name_crm__c}; ;
RoutingOrder~2' ; 

//Custom Envelop from Docusign 
var DST='B85135B8-6F97-49C6-AAE3-96333518AC5D'; 

//********* Page Callout (Do not modify) *********// 
window.location.href =
  "/apex/dsfs__DocuSign_CreateEnvelope?DSEID=0&SourceID={!Opportunity.Id}&RC="+RC
  +"&RSL="+RSL+"&RSRO="+RSRO+"&RROS="+RROS+"&CCRM="+CCRM
  +"&CCTM="+CCTM+"&CRCL="+CRCL+"&CRL="+CRL+"&OCO="+OCO
  +"&DST="+DST+"&CCNM="+CCNM+"&LA="+LA+"&CEM="+CEM+"&CES="+CES
  +"&SRS="+SRS+"&STB="+STB+"&SSB="+SSB+"&SES="+SES
  +"&SEM="+SEM+"&SRS="+SRS+"&SCS="+SCS+"&RES="+RES;
//*******************************************//

The docs say 医生

You can specify multiple comma-separated recipients but the length of the entire CRL string must be 1000 characters or less. 您可以指定多个逗号分隔的收件人,但整个CRL字符串的长度必须为1000个字符或更少。

In other words (I agree the docs could be improved), each recipient in the CRL string has multiple, optional fields. 换句话说(我同意可以改进文档),CRL字符串中的每个收件人都有多个可选字段。 For a specific recipient, separate the fields with semicolons. 对于特定的收件人,请用分号分隔字段。

Separate the multiple recipients with commas. 用逗号分隔多个收件人。 (This is what you missed.) (这是您错过的。)

Also, your JavaScript could be a little clearer. 另外,您的JavaScript可能会更清晰一些。 You can define multiple variables with a single var statement. 您可以使用单个var语句定义多个变量。 You also don't need to repeat the var statement for a given variable. 您也不需要为给定的变量重复var语句。

Try: 尝试:

{!REQUIRESCRIPT("/apex/dsfs__DocuSign_JavaScript")} 

//********* Option Declarations (Do not modify )*********// 
var RC = '', RSL='',  RSRO='', RROS='', CCRM='',
    CCTM='', CCNM='', CRCL='', CRL='',  OCO='',
    DST='',  LA='',   CEM='',  CES='',  STB='',
    SSB='',  SES='',  SEM='',  SRS='',  SCS ='', RES=''; 
//*************************************************// 

// Docs: https://support.docusign.com/guides/dfs-admin-guide-customize-envelope-contacts

// Adding Notes & Attachments 
LA='0'; 

// Custom Recipient Contact List 
var 
  recip1 = "Email~{!Opportunity.Client_Signer_Email_crm__c};" +
           "FullName~{!Opportunity.Client_Signer_Full_Name__c};" + 
           "RoutingOrder~1;",
  recip2 = "Email~{!Opportunity.Customer_Signer_Email_crm__c};" +
           "FullName~{!Opportunity.Customer_Signer_Full_Name_crm__c};" +
           "RoutingOrder~2"; 

CRL = recip1 + "," + recip2;

//Custom Envelop from Docusign 
DST='B85135B8-6F97-49C6-AAE3-96333518AC5D'; 

//********* Page Callout (Do not modify) *********// 
window.location.href =
  "/apex/dsfs__DocuSign_CreateEnvelope?DSEID=0&"
  +"SourceID={!Opportunity.Id}&RC="+RC
  +"&RSL="+RSL+"&RSRO="+RSRO+"&RROS="+RROS+"&CCRM="+CCRM
  +"&CCTM="+CCTM+"&CRCL="+CRCL+"&CRL="+CRL+"&OCO="+OCO
  +"&DST="+DST+"&CCNM="+CCNM+"&LA="+LA+"&CEM="+CEM+"&CES="+CES
  +"&SRS="+SRS+"&STB="+STB+"&SSB="+SSB+"&SES="+SES
  +"&SEM="+SEM+"&SRS="+SRS+"&SCS="+SCS+"&RES="+RES;
//*******************************************//

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM