问题描述
我正在尝试使用Salesforce中的SOAP API从模板中发送文档.我使用了代码演练推荐答案 我不相信该过程中的文档通过DS API有实际文档,但是您希望将Objectid成为一个信封自定义字段.信封自定义字段应命名为" ## sf {objectid}",因此对于opp,它将是## sfopportunity. 您还需要将自定义对象映射到Connect中的自定义字段(通过DS Web应用程序),屏幕截图使用引号,但是对于任何自定义对象,都应该相同. 另外,如果您希望在该自定义对象指令上的docusign状态映射回去在这里.我认为尽管从API发送而不是Salesforce Manage软件包的DocuSign,但状态仍将正确恢复. 我找到了更好的方法.感谢您的回答,它使我获得了更好的解决方案.
对于其他与DocuSign API斗争的人,这是如何做到的. 我更改了创建自定义字段的代码,以包含ID之后的对象名称.
现在,当我通过API发送文档和按钮单击时,我可以看到附件.其他推荐答案
到目前为止,我们所做的一切都很好.自定义字段的问题是您无法在自定义按钮中引用它.因此,我无法直接在我的自定义对象上看到附件.
我将映射更改为指向外部源ID而不是自定义字段.
我发送了一个带有Salesforce的自定义按钮的文档,并使用API Explorer获取信封资产 - 自定义字段.这就是结果.这就是按钮映射源的方式.{
"fieldId": "84508346",
"name": "DSFSSourceObjectId",
"show": "false",
"required": "false",
"value": "a2H11000001XXXX~My_Custom_Object__c"
},
享受所有好人!
问题描述
I'm trying to send a document from a template using SOAP APi in Salesforce. I used the code walkthrough NDA kiosk as an example. I can pre-set the values but the value of the fields isn't written back to Salesforce. When I send the document from DocuSign button the values are synced as expected. // Add data for fields DocuSignAPI.TemplateReferenceFieldDataDataValue fd1 = new DocuSignAPI.TemplateReferenceFieldDataDataValue(); fd1.TabLabel = 'Full Name 1'; fd1.Value = recipient.UserName;
ndaTemplate.FieldData = new DocuSignAPI.TemplateReferenceFieldData(); ndaTemplate.FieldData.DataValues = new DocuSignAPI.ArrayOfTemplateReferenceFieldDataDataValue(); ndaTemplate.FieldData.DataValues.DataValue = new DocuSignAPI.TemplateReferenceFieldDataDataValue[1]; ndaTemplate.FieldData.DataValues.DataValue[0] = fd1;
//LINK THE Object with custom field
DocusignNetApi.CustomField field = new DocusignNetApi.CustomField (); //field.Name = 'DSFSSourceObjectId'; field.Name = '##SFCustom_Object__c'; field.Value = pCustomObjectId; field.Show = 'false'; DocusignNetApi.ArrayOfCustomField arrayOfCustomField = new DocusignNetApi.ArrayOfCustomField(); arrayOfCustomField.CustomField = new DocusignNetApi.CustomField[1]; arrayOfCustomField.CustomField[0] = field; pEnvelopeInformation.CustomFields = arrayOfCustomField;
I do set external object ID in the custom fields and the envelope and recipient status are related to my custom object. I'm not really sure how to achieve what I want. Can someone refer me to a doc?
推荐答案
I do not believe there is actual documentation on the process via the DS API, but you have it correct that you want the objectID to be an envelope custom field. The envelope custom field should be named "##SF{objectID}" so for an Opp it would be ##SFOpportunity.
You'll also need to map back the custom object to the custom field in Connect (via the DS web app), the screenshot is using Quotes, but it should be the same for any custom object.
Also if you want the DocuSign Status on that custom object instructions to map it back can be found here. I think the Status will come back properly despite being sent from the API as opposed to the DocuSign for Salesforce manage package.
其他推荐答案
I found a better way. Thank you for your answer it lead me to a better solution.
For anybody else who struggles with docusign API here is how to do it.
What we did so far was good. The problem with custom field is you can't reference it in custom button. So I wasn't able to see attachments directly on my custom object.
I changed the mapping to point to External Source Id instead of the custom field.
I sent a document with custom button from Salesforce and I used API explorer to get envelope assets - custom fields. This was the result. This is how SourceId from the button was mapped.
{ "fieldId": "84508346", "name": "DSFSSourceObjectId", "show": "false", "required": "false", "value": "a2H11000001XXXX~My_Custom_Object__c" },
I changed my code that created the custom field to contain the object name after the ID.
Now I can see attachments when I send the document via API and from button click.
Enjoy all good people!