New support for tabs in the Apex Toolkit


We’re excited to announce that the latest release of the Apex Toolkit includes expanded support for tabs. Included in the DocuSign Apps Launcher version 2.8, this new feature gives developers more ways to customize their individual documents without using templates.

Tabs are places in a document where a recipient provides input or where calculated values are displayed. Each tab is assigned to a recipient, and the signing process is complete when each of those recipients has entered data for all of their tabs. 

Previously, you had to use DocuSign templates if you wanted to include tabs in your documents. With the latest Apex Toolkit release, you can generate new documents without templates and place tabs directly in those documents using any of the classes defined for each tab type. The Apex Toolkit supports all of the currently available tab types, all of which can be added to a document at a specified position or using anchor positioning

The code below demonstrates how to define a Sign Here tab and specify its position in a document using the withPosition method.

// Create a Sign Here tab
dfsle.Tab mySignHereTab = new dfsle.SignHereTab()
    .withScale(0.5) // 1/2 scale
    .withRequired(true) // Signing is mandatory
    .withPosition(new dfsle.Tab.Position(
        1, // The document to use
        1, // Page number on the document
        200, // X position
        200, // Y position
        null, // Default width
        null)); // Default height

You can also define a tab with anchor positioning. The code below demonstrates the definition of an Initial Here Tab using the .withAnchor method to place it at a specific word in the document.

// Create an anchor 
dfsle.Tab.Anchor myAnchor = new dfsle.Tab.Anchor('Acknowledgement');
// Create an Initial Here tab
dfsle.Tab myInitialHereTab = new dfsle.InitialHereTab()
    .withRequired(false) // Signing optional

Tabs can be added to a recipient using the withTabs method on the Recipient object. The code below demonstrates how to create a new Recipient object from a Salesforce source and add the tabs defined previously to that recipient.

// Create a new recipient
dfsle.Recipient myRecipient = dfsle.Recipient.fromSource(
'Signer Person', // Signer name
'', // Signer email
null, // Signer phone number
'Signer 1', // Signer role
null) // No Salesforce association
.withTabs(new List<dfsle.Tab> { // Associate the tabs with this recipient

New to the Apex Toolkit?

Similar to a Software Development Kit (SDK), the Apex Toolkit provides developers with a set of Apex classes and methods that access DocuSign’s eSignature API. You can use the Apex Toolkit to build out custom workflows and processes that integrate DocuSign into your Salesforce implementation. The Developer Center has plenty of resources to get you started with these new features and many others offered in the Apex Toolkit.  For a more detailed example of the new tab functionality, check out How to send an envelope with tabs.


Additional Resources

Paige Rossi
Paige Rossi
Programmer Writer