【问题标题】:adding TextBox Field and Picklist to pdf that send through DocuSignAPI将文本框字段和选项列表添加到通过 DocuSignAPI 发送的 pdf
【发布时间】:2018-05-18 17:35:36
【问题描述】:

我有一个 visualforce 页面 renderAs pdf,它使用 DocuSign SOAP API 发送。我需要通过 DocuSign SOAP API 在 pdf 上添加一个 testArea 字段和选择列表。

我在此链接上发现选项卡参数具有文本选项卡字段和列表选项卡字段。

click here for Tab Parameters

如何在代码中编写这两个字段。我的假设应该是这样的。

DocuSignAPI.Tab tab1 = new DocuSignAPI.Tab();
    tab1.Type_x = 'Text';
    tab1.RecipientID = 1;
    tab1.DocumentID = 1;
    tab1.AnchorTabItem = new DocuSignAPI.AnchorTab();
    tab1.AnchorTabItem.AnchorTabString = 'bio:';

    envelope.Tabs = new DocuSignAPI.ArrayOfTab();
    envelope.Tabs.Tab = new DocuSignAPI.Tab[1];
    envelope.Tabs.Tab[0] = tab1;  

当我发送它时,我得到了这个错误

异常 - System.CalloutException:Web 服务调用失败:WebService 返回 SOAP 错误:服务器无法读取请求。 ---> XML 文档中有错误。 ---> 实例验证错误:“文本”不是 TabTypeCode 的有效值。 faultcode=soap:Client faultactor=

【问题讨论】:

  • 您想使用 REST API 但收到 SOAP 错误,这怎么可能?您使用的是 SOAP API 还是 REST?
  • @AmitKBist 我正在使用 SOAP 我会更新我的问题,谢谢

标签: docusignapi visualforce


【解决方案1】:

对于TextTabtype 必须是 CustomCustomTabType 应该是 Text。要添加 TextTab 和 Dropdown,XML 将如下所示:

<ns:Tab>
    <ns:DocumentID>32093411</ns:DocumentID>
    <ns:RecipientID>45399085</ns:RecipientID>
    <ns:PageNumber>1</ns:PageNumber>
    <ns:XPosition>124</ns:XPosition>
    <ns:YPosition>261</ns:YPosition>
    <ns:Type>Custom</ns:Type>
    <ns:TabLabel>Text b5a8927a-4f93-4288-b280-d15023b1b834</ns:TabLabel>
    <ns:CustomTabType>Text</ns:CustomTabType>
</ns:Tab>
<ns:Tab>
    <ns:DocumentID>32093411</ns:DocumentID>
    <ns:RecipientID>45399085</ns:RecipientID>
    <ns:PageNumber>1</ns:PageNumber>
    <ns:XPosition>349</ns:XPosition>
    <ns:YPosition>261</ns:YPosition>
    <ns:Type>Custom</ns:Type>
    <ns:Name>Red;Blue</ns:Name>
    <ns:TabLabel>Dropdown e7f5ad78-9e10-4339-b342-023a729549b7</ns:TabLabel>
    <ns:CustomTabType>List</ns:CustomTabType>
    <ns:CustomTabListItems>Red;Blue</ns:CustomTabListItems>
    <ns:CustomTabListValues>Red;Blue</ns:CustomTabListValues>
</ns:Tab>

【讨论】:

  • 在哪里可以找到 xml 文件,还是必须创建一个并将其上传到品牌?我对docusign有点陌生
  • 您指的是哪个 XML 文件?
  • 在您上面的回答中,您希望我将上面的代码添加到 XML 中。是那里的 XML 文件,需要编辑或创建新的 XML 文件并上传
  • SOAP 适用于 XML,我没有编写代码的类工件。我给出了上面使用 SOAPUI 测试的 XML,这将由您的编码语言创建。您需要使用您的 visualforce 类来创建 XML。
【解决方案2】:

扩展 Amit 的回答:如果使用 DocuSign SOAP Apex SDK,我相信您会想要文本选项卡中类似的内容:

tab1.Type = "Custom"
tab1.CustomTabType = "Text"

选择列表是:

tab2.Type = "Custom"
tab2.CustomTabType = "List"
tab2.Name = "Red;Green;Blue"

列表使用分号分隔的名称值来填充选项。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-09-24
    • 1970-01-01
    • 2018-05-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-09-14
    相关资源
    最近更新 更多