将 TextBox Field 和 Picklist 添加到通过 DocuSignAPI 发送的 pdf

adding TextBox Field and Picklist to pdf that send through DocuSignAPI

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

我在这个 link 上发现选项卡参数有文本选项卡字段和列表选项卡字段。

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 文件中有错误。 ---> 实例验证错误:'Text' 不是 TabTypeCode 的有效值。 faultcode=soap:Client faultactor=

对于 TextTabtype 必须是 CustomCustomTabType 应该是 Text。要添加 TextTab 和下拉菜单,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>

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

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

选择列表为:

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

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