简体   繁体   中英

adding TextBox Field and Picklist to pdf that send through DocuSignAPI

I have a visualforce page renderAs pdf it uses DocuSign SOAP API to be send. I need to add a testArea field and picklist on the pdf through DocuSign SOAP API.

I found on this link that tab parameters has Text Tab field and List Tab field.

click here for Tab Parameters

how I can write those two fields in the code. My assumption it should be something like this.

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;  

when I send it I get this error

Exception - System.CalloutException: Web service callout failed: WebService returned a SOAP Fault: Server was unable to read request. ---> There is an error in the XML document. ---> Instance validation error: 'Text' is not a valid value for TabTypeCode. faultcode=soap:Client faultactor=

For TextTab , type has to be Custom and CustomTabType should be Text . To Add TextTab and Dropdown, XML will look like below:

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

To expand on Amit's answer: If using the DocuSign SOAP Apex SDK, I believe you would want something along the lines of this for the text tab:

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

The picklist would be:

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

as lists use a semicolon separated Name value to populate options.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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