Salesforce Integration with PandaDoc – Part 1: Install

Focus: The focus of this document is to provide you steps on how to install the PandaDoc module in Salesforce.

What does the integration do?
The Salesforce integration with PandaDoc will allow you to create PandaDoc documents from Opportunities, Leads and Account. You will be able to pull information from Opportunity, Leads and Account information, Salesforce products into a PandaDoc document and setup triggers.

Feature availability: This feature is available in our in Add-on Store. Please go to the “Add-on Store” found on the bottom left of your account to locate and enable. Click here to learn  more about the Add-on Store.

PandaDoc Plans: In order to use this integration you will need to be on the Business or Enterprise plan.

Version 1.26 Notes: This version will no longer be available after 3/11/2016. This version works with Salesforce “Group”, “Professional”, “Enterprise”, “Unlimited”, or “Developer edition”. This version does not include Triggers. You will need to have Salesforce Admin rights to install the PandaDoc module.

Version 1.30 Notes: Available after 3/11/2016. You will need Salesforce: “Enterprise”, “Unlimited”, or “Developer edition”. You will have the features available in Version 1.30 and the ability to create triggers are only in this edition. You will need to have Salesforce Admin rights to install the PandaDoc module. If you would like to install this version, please contact Support within PandaDoc by clicking on the green “Help Button” at the bottom right.

Existing Installs: If you have any previous versions installed, please note that once you upgrade you will cannot revert to a previous version.

Table of Contents:

Configuration of PandaDoc Module in Salesforce
Connecting Pandadoc and Salesforce
Adding PandaDoc module to Custom Objects in Salesforce

Configuration of PandaDoc Module in Salesforce

Step 1a: Log into your Salesforce account:

Step 1b: In the same window of your web browser, open this link in a new tab to install the PandaDoc Add-On: and download version 1.30.

Install - 1

Click on “Install for All Users”, then click “Install”.

Step 1c: Select, “Yes, grant access to these third-party web sites” and Click on “Continue.” The module will begin to install in Salesforce. Click on “Done” to complete the process.

Install - 4

Step 1d: Go to any record under “Opportunity” and click on “Edit Layout.”

Step 1e: On the left side under “Build,” expand “Customize” > “Opportunities” and select “Page Layout.” In the “Opportunity Layout” module at top, navigate to “Fields” and find “Sections.”

Step 1f: Click and drag “Sections” to where you want PandaDoc to display in the Opportunity Layout. Once added, setup the section properties. Name this new section “PandaDoc Documents.” Set the layout to “1-Column” and select “OK.”

SF Install - 8- Add Section to Opp Layout

Step 1g: Go back to the “Opportunity Layout” module above. Find “Visualforce Pages” on the left and drag “PandaDoc” to the previously created section.

SF Install - 9- Adding the Visuals

Step 1h: Click on “Properties” on the right and set the “Height (in pixels)” to at least 500. The larger the number, the larger the module will appear in Salesforce.

SF Install - 10 - Configuring the Visuals

Step 1i: In the “Opportunity Layout” module above, click on “Save.” Wait for the layout to finish saving and now you should have your PandaDoc module show up.

SF Install - 11 - Saving the layout

Step 1j: Go to any object under “Opportunities” to see if the module named “PandaDoc Documents” appears.

SF Install - 12- Connect with PandaDoc

Note: To use PandaDoc under the objects “Leads” and “Accounts,”  you need to go to a record and repeat Steps 1d to 1j under each object.

Connecting Pandadoc and Salesforce

Step 2a: Inside PandaDoc, go to “Settings” > “Integrations” > Click on “Salesforce.” > Select “Enable Salesforce Integration.” 

Step 2b: Click on “Connect PandaDoc to Salesforce” to link PandaDoc account to Salesforce. You may need to log into Salesforce if you haven’t already. Click on “Allow” to authorize PandaDoc access to Salesforce.

If need be, you can also connect to Salesforce Sandbox environment for testing:
SF Install -- Connect to Sandbox Salesforce

Your PandaDoc account is now connected to Salesforce.

Optional Setup for Salesforce Triggers

To setup optional Salesforce Triggers, please continue to Step 2c.

Step 2c : If you want to use Salesforce triggers, copy the API Key under “Step 4: Setup Salesforce – PandaDoc Sync.”

Step 2d: Log into your Salesforce account and click on “+” symbol at the top and then select “PandaDoc Setup.”

Salesforce integration - PandaDoc Module Access

Step 2e: In the “Two-way sync from PandaDoc to Salesforce,” paste the token into the “API Key” box and click on “Update.” To learn more about Salesforce triggers and how to use them, please click here.

Adding PandaDoc module to Custom Objects in Salesforce

If you created a “Custom Object” in Salesforce and you want to add the PandaDoc module to it, you will need go through the steps for each Custom Object. (Click here to learn how to create a Custom Object within Salesforce)

Initial configuration of Custom Object in Salesforce

Step 3a: Go to Config -> [Custom Object Name] -> Field Sets and add a fieldset with a name CUSTOMOBJNAME_PANDADOC (replace CUSTOMOBJNAME to a custom object name, all upper case, no spaces). For example for object Test (custnmsp__Test__c) field set should be named TEST_PANDADOC.

Step 3b: Custom object should have a field Name and this name should be added to a created field set.

Custom JSON Builder
PandaDoc will look for a custom JSON builder for your custom object to serialize object’s data and pass it to PandaDoc when you create a document from this object page.

Step 3c: Custom JSON builder should extend pandadoc.JsonBuilder.

Step 3d: There should be a default constructor with no parameters.

Step 3e: You should call a parent’s constructor in your default constructor and pass 2 arguments there:

  • Schema.sObjectType of an object which you’re building JsonBuilder for (you can get it via [sObjectName].getSobjectType())
  • Map<String, Set<String>> – a Map where you define nested objects you want to add to JSON. Key is a name of child relation and value is a list of fields from child relation object. You can pass null, if you don’t need to configure child relations. (Start with null and extend later).

Step 3f: JsonBuilder should implement all abstract methods of a base class. If you don’t need this information, please return null.

  • global abstract List<Recipient> getRecipients(sObject record); – returns a list of recipients from a custom object (will be prepopulated in PandaDoc);
  • global abstract List<Item> getItems(sObject record); – returns a list of products (pricing table items, will be prepopulated in PandaDoc).

Add a created JsonBuilder to Json Builder Factory

Step 3g: Go to PandaDoc custom settings

Step 3h: Open “PandaDoc JsonBuilder Mapping”

Step 3i: Add an entry where: name is custom object API name with a namespace and JsonBuilder Class Name – custom JsonBuilder class name with a namespace (e.g. pandadoc.AccountJsonBuilder)

Adding PandaDoc Module using VisualForce Pages
To embed the PandaDoc module your custom object pages, you will need to create a VisualForce component and add it to custom object’s page layout.

Step 3j: VisualPage code is below. Where CUSTOM_OBJECT_API_NAME is an API name of a custom object. Add this page to your custom object layout when it’s done (see our FAQ, Step 4).

Next, please click on the this link to go through the Setup and Customization of the Salesforce PandaDoc integration.

If you have already done this, check out the general guide of how to send documents using this integration, here.

Have questions? For faster support please:

  1. Log in to PandaDoc
  2. Then click on the help button
  3. Choose Contact Support option

Or feel free to contact us using our public form:

Contact Support