🎉  Build a workflow powerhouse. Learn more about our new Airtable integration.   🎉

July 08, 2013

Create PDF Contracts and Agreements from Salesforce

For many businesses, Salesforce is an integral part of managing a sales and marketing teams.  From handling leads to creating opportunities, Salesforce has you covered on internal information management, but Formstack Documents can help you complete the process. 

Formstack Documents takes your CRM information and generates customized PDFs or Word documents that you can send to your customers or other internal departments.

Learn More: The Formstack Documents Salesforce App is built right into your CRM workflow. Click here for more information and to install.

In this example, we’ll be generating a simple contract/agreement using a Contract object in Salesforce.

The first step will be to setup the Formstack Documents document (the agreement) – and we’re going to use the online editor.  Go ahead and create a New Document, then choose the “Build Your Own” option.  In the editor, add your field placeholders where you want the information from Salesforce to go.  Think of this as a template. 

After you have setup your document (added the field placeholders), let’s go to the Merge tab.  On the Merge page, you’ll see the Merge URL.  Copy that URL, we’ll need it here in a second.

Now, let’s jump into Salesforce and setup the button that is going to send the information from your Contract object to Formstack Documents.  To do this, you’ll want to go to the Apps and Administrator Setup page (usually under the dropdown when you click your name in the right corner) and click the Customize > Contracts > Buttons and Links.

Next, let’s create a new Button that we’ll place on the “detail page” of each contract.  To do this, click the New Button or Link button.  On this step you’ll setup the button and map the information that you want to go over to Formstack Documents.  Go ahead and fill out the information on the form (button label, name, etc) – you’ll want to choose Detail Page Button for the Display type and to open in a new window.  The content source is a URL.

This is the most technical piece – setting up the URL to send the information to Formstack Documents.  Remember when I said to copy that Merge URL from the document you setup?  Here is where we need it.  Go ahead and paste that URL into the big box.  There is a little more information we need to add to the URL before we start adding the fields.  You’ll want to add “&_use_get=1” to the URL so that Formstack Documents looks for the variables in the URL.  And if you want the PDF to open up right away (so you can save to computer), then you’ll want to add “&download=1” to the URL as well.

Now, let’s add our fields to the URL.  This is very similar to adding the _use_get=1 that you added above, except you are going to use the name that you used in your document (ie. Name or Email) and then after the = sign you will put the field (using the Insert Merge Field dropdown above the box).

Go ahead and save the button and we’ll move onto adding the button to your Detail Page layout for your Contracts.  To do this, click the Page Layout link on the left under Customize > Contracts, then if needed, click the edit link.  The next page should be the layout builder and you’ll want to click the buttons section in the top bar, then drag the button you created down into the Custom Buttons section on the page.  Click Save and you’re all set!

Now, go take a look at one of your contracts (create a new one if you don’t have any) and click the Formstack Documents button.  You should see a new popup window open and then your document should popup as well.  You’re done!

Please let us know if you have any questions.

4 min read

Ready to give Formstack Documents a try?
Start your Free Trial now!


Create Documents From Salesforce Now

By signing up here, you agree to our Terms of Use