Focus: The focus of this document is to provide you steps on how to install the PandaDoc module into custom objects in Salesforce.
If you have not gone through the installation of PandaDoc into Salesforce, please click here and follow all steps.
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)
Salesforce Versions for Custom Objects: You will need Salesforce: “Enterprise”, “Unlimited”, or “Developer edition”. Salesforce Pro does not offer access to APEX classes and are unable to use custom objects with this integration.
For developers, click here to find detailed documentation with code examples on how to add custom objects to your Salesforce-PandaDoc integration.
Step 1: Create or Access Your Salesforce Custom Object
Step 1a: Go to Setup -> Build -> Create -> Objects
Step 1b: Select your Custom Object or create a new one by clicking “New Custom Object”.
Step 2: Create a Fieldset for the Custom Object
Step 2a: Scroll down to the section “Field Sets” and select “New” to create a new Field Set for the Custom Object.
Step 2b: Enter the Field Set information as follows and select “Save”:
- Field Set Label: OBJECTNAME_PANDADOC
- Field Set Name: OBJECTNAME_PANDADOC
For this example, we’ll create a Custom Object called “Service City”, representing an area a business provides services in. We might have documents to store for operations in each area.
Step 2c: Save the Field Set
Step 3: Create Custom JSON Builder for Custom Object
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 here how to Create a custom JSON builder.
Step 3a: On the top bar, click “+” and select “PandaDoc Setup.”
Step 3b: 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.
Step 3c: Once done, you can further customize Pricing Items and Recipients that will be pulled automatically into the PandaDoc document.
In JSON builder settings under Actions select “Setup”:
In Setup, you can configure Related Pricing Items and Recipients.
Each list contains entities in lookup relationship with your selected custom object.
Once you selected 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.
Step 4: 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.
Step 4a: Go to Setup -> Develop -> Visualforce Pages and click on “New” to add a new Visualforce page.
Step 4b: Enter a Visualforce Label and Name for your page.
Step 4c: Copy the source of this linked Visaulforce template and paste it into the “Visualforce Markup” section of the page settings: https://github.com/PandaDoc/pandadoc-sfdc-examples/blob/master/src/pages/CustomObjectPandaDoc.page
Step 4d: Replace the following value in the template with your controller name:
- Line 1:
Step 4e: Save the Visualforce page.
Step 5: Insert the Visualforce page into your Custom Object view.
Step 5a: Go to Setup -> Create -> Custom Objects, and select your Custom Object from the list of Custom Objects.
Step 5b: Scroll down to “Page Layouts” and select “Edit” to edit your Custom Object’s page layout.
Step 5c: From “Fields” select “Section” and drag a new section into your page layout.
Step 5d: Be sure to name the section and select a 1-Column layout. Then select “OK”.
Step 5e: From “Visualforce Pages” select your Custom Object Visualforce Page and drag the page into the Section you just created.
Step 5f: Save the layout.
Step 6: Finished
Your Custom Object layout will now have PandaDoc documents in the view that are associated with each Custom Object record.