Skip to main content
All CollectionsIntegrationsCRMs
Salesforce Classic: Add PandaDoc to custom objects
Salesforce Classic: Add PandaDoc to custom objects
M
Written by Marya Maksimchuk
Updated over a week ago

Before you work with this guide, make sure you've installed PandaDoc for Salesforce, please click here and follow all steps.

Note, 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.

Salesforce Versions for Custom Objects: You will need Salesforce: “Enterprise”, “Unlimited”, or “Developer edition”.

For developers, click here to find detailed documentation with code examples on how to add custom objects to your Salesforce-PandaDoc integration.

Add the PandaDoc module to Custom Objects

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

With the new version, PandaDoc allows you to quickly setup PandaDoc module for a custom Salesforce object using the predefined JSON Builder. You will have the option to pull Pricing items and Recipients into a PandaDoc document.

If are using an older integration version or you’d like to set up a more customizable option, please see the detailed documentation attached at the end of the article.

  1. On the top bar, click “+” and select “PandaDoc Setup”;

  2. At the bottom you will find the JSON builder settings, click “Add PandaDoc to Custom object”. The system will prompt you to select the custom object that you want to connect PandaDoc with.

Create_Custom_JSON_Builder_for_Custom_Object.png
Create_Custom_JSON_Builder_for_Custom_Object_1.png

Create a VisualForce Page for the Custom Object

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.

  1. Go to Setup > Develop > Visualforce Pages and click on “New” to add a new Visualforce page;

  2. Enter a Visualforce Label and Name for your page;

  3. Follow the link and copy the source of the Visaulforce template and paste it into the “Visualforce Markup” section of the page settings: https://github.com/PandaDoc/pandadoc-sfdc-examples/blob/master/examples/force-app/main/default/pages/PandaDocForCustomObject.page

  4. Replace the following value in the template with your object name which you can find in JSON Builder Settings section, in the Object Name column:

Line 1:

standardController="CustomObject__c"

Save the Visualforce page.

Create_a_VisualForce_Page_for_Custom_Object_0.png
Create_a_VisualForce_Page_for_Custom_Object_1.png
Create_a_VisualForce_Page_for_Custom_Object_2.png

Insert the Visualforce page into your Custom Object view

  1. Go to Setup > Create > Custom Objects, and select your Custom Object from the list of Custom Objects;

  2. Scroll down to “Page Layouts” and select “Edit” to edit your Custom Object’s page layout. From “Fields” select “Section” and drag a new section into your page layout;

  3. Name the section and select a 1-Column layout. Then select “OK”;

  4. From “Visualforce Pages” select your Custom Object Visualforce Page and drag the page into the Section you just created;

  5. Save the layout.

Your Custom Object layout will now have PandaDoc documents in the view that are associated with each Custom Object record.

Insert_Visualforce_page_into_Custom_Object_view_0.png
Insert_Visualforce_page_into_Custom_Object_view_1.png
Insert_Visualforce_page_into_Custom_Object_view_2.png

Pass data from SFDC into PandaDoc

In order to pass data from Salesforce to PandaDoc document, first you should create your template and set it up with Tokens (same as Merge Fields). Learn more about tokens here.

Important information about tokens: Although tokens can automatically populate information in your document, they can only be added/edited in templates, not documents.

Note:

If you want to pass data to PandaDoc which would be editable for Recipients, refer to the paragraphs below with the prefix “(via Fields)”.

Passing Salesforce fields into PandaDoc (via tokens)

Before setting up your template with tokens, create a tokens list for the custom object you will use PandaDoc with.

Note:

Tokens must be setup for each object individually. Only the tokens listed in that particular object will be available when creating a document from it (no cross-object population.)

  1. For that, click “+” and go to Pandadoc Setup. Scroll down to “Salesforce to PandaDoc data flow” and click “Configure objects”;

  2. Next, click “Add object” and choose your custom object;

  3. You will see a default list of tokens on the right. To add more, check the fields you want to add to the tokens list and click “Save”;

  4. Open your PandaDoc template in a separate browser window, copy & paste token names with the square brackets into the template.

When you create a document from Salesforce using this template, the tokens will be filled out with the information from the CRM.

PandaDoc_setup_new_version.png
Field_set_access.png
Field_set_pick_tokens.png
mceclip0.png

You can also review the list of tokens along with the data that will be passed in the Salesforce record.

  1. Open a Salesforce record, scroll down to PandaDoc, click the gear icon in the top right corner of the module and choose Tokens/Variables - this is what you can pass;

  2. Open your PandaDoc template in a separate browser window, copy & paste Token names with the square brackets into the template.

Passing_standard_Salesforce_fields_PandaDoc_0.png

Note:

In case the field in Salesforce is empty, the Token/Variable in the document will not be populated and you will have to fill it in manually.

Passing Salesforce fields into PandaDoc (via Fields)

You can pass data into PandaDoc fields similarly to how variables operate. Unlike with variables, however, you don’t need to include square brackets.

In the list of tokens, copy the token without square brackets into Merge field.

mceclip0.png
mceclip1.png

Once the document has been sent, the recipient will see the pre-filled data and be able to update this field, provided the field has been assigned to them.

Configure passing recipients and pricing items data into PandaDoc

Now you should set up lookup relationship for your custom object:

  1. In JSON builder settings under Actions select “Setup”;

  2. Configure Related Pricing Items and Recipients by selecting lookup relationship for them;.

Once you select and saved the Related Items, the information about Pricing items and Recipients will be automatically pulled into a PandaDoc document created from your custom object.

Configure_passing_recipients_and_pricing_items_data_into_PandaDoc_0.png
Configure_passing_recipients_and_pricing_items_data_into_PandaDoc_1.png
Did this answer your question?