Blog
Home/

New support for tabs in the Apex Toolkit

Paige Rossi
Paige RossiSr. Programmer Writer
Summary3 min read

The latest release of the Apex Toolkit gives developers the ability to add tabs to documents sent through Salesforce.

    • New to the Apex Toolkit?
    • Additional Resources

    Table of contents

    Apex

    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
        .withAnchor(myAnchor);
    
    

    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@example.com', // 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
    mySignHereTab,
    myInitialHereTab
    });</dfsle.tab>
    

    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 RossiSr. Programmer Writer

    Paige has been working for Docusign since 2020. As a Sr. Programmer Writer on the Developer Content team, she writes content and code to help developers learn how to use Docusign APIs.

    More posts from this author

    Related posts

    • Developer Spotlight

      Developer Spotlight is Coming to Docusign Community!

      Matthew Lusher
      Matthew Lusher
    • Breaking the Language Barrier: Why Large Language Models Need Open Text Formats

      Dan Selman
      Dan Selman
    • Understanding Levenshtein Distance: Applications to AI-Generated Text

      Vincent Pan
      Vincent Pan

    Developer Spotlight is Coming to Docusign Community!

    Matthew Lusher
    Matthew Lusher

    Understanding Levenshtein Distance: Applications to AI-Generated Text

    Vincent Pan
    Vincent Pan

    Discover what's new with Docusign IAM or start with eSignature for free

    Explore Docusign IAMTry eSignature for Free
    Person smiling while presenting