簡體   English   中英

將TextBox字段和選擇列表添加到通過DocuSignAPI發送的pdf中

[英]adding TextBox Field and Picklist to pdf that send through DocuSignAPI

我有一個visualforce頁面renderAs pdf,它使用DocuSign SOAP API進行發送。 我需要通過DocuSign SOAP API在pdf上添加一個testArea字段和選擇列表。

我在此鏈接上發現選項卡參數具有“文本選項卡”字段和“列表選項卡”字段。

單擊此處以獲取選項卡參數

我如何在代碼中編寫這兩個字段。 我認為應該是這樣的。

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 =肥皂:客戶端faultactor =

對於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>

擴展Amit的答案:如果使用DocuSign SOAP Apex SDK,我相信您會希望在文本選項卡上使用以下內容:

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

選擇列表為:

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

列表使用分號分隔的Name值填充選項。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM