Complete Installation and Setup Guide

Install WebMerge from the AppExchange

Head over to the AppExchange and search for WebMerge or go to to get started.

Sign in as a System Administrator for the Salesforce Org that you’d like to install WebMerge for

Once you’re logged in, you’ll be presented with details on what will be installed into your Salesforce Organization.

After reviewing, click Continue.



Salesforce needs permission to talk to WebMerge. Check the box for Yes, grant access to these third-party web sites and click Continue.




Review the Object Permissions on the next page and click Next.




Select a security level. Grant access to all users is recommended if you want your users to be able to merge documents themselves. There are some areas of the WebMerge for application that will only be accessible from System Administrators.




Click Install and you’ll receive an email when WebMerge for is installed in your organization.



Installed and ready to go!



Accessing WebMerge for

You can access WebMerge for at any time in your Apps dropdown in the top right of Salesforce.



WebMerge for gives you access to three new Tabs:

1.    Webmerge Documents

2.    Webmerge Mappings

3.    Webmerge Settings


These Tabs are where you will be able to manage your WebMerge document mappings and settings.





WebMerge Settings


To give access to your WebMerge documents, we need to setup an API Key and API Secret in WebMerge.



Visit and either sign in or create a new account.




Under your Profile, click on API Access.




Click on Click here to create an API Key! to get started.


Give your API Key a name. For this example, we’re going to call it WebMerge for Salesforce.





Now you want to copy and paste the API Key and API Secret from WebMerge into WebMerge for settings.



 Click Login to WebMerge using your new API credentials.



 If everything was entered correctly, you’ll be logged in.




Managing WebMerge Documents

Now that you are logged in to WebMerge, you can view the WebMerge Documents and WebMerge Mappings tabs.


Click on WebMerge Documents and you’ll see that we have given you full access to your WebMerge account right within Salesforce. You can create new Documents or Data Routes here and they will be available to be used in the WebMerge Mappings tab.





Creating a WebMerge Mapping

WebMerge for Salesforce allows you to create WebMerge document mappings using data from records.




Click New WebMerge Mapping to get started on creating a new mapping.




Fill out the details on the New WebMerge Mapping screen:

·         Mapping Name: Give this mapping a name that will be descriptive to you and your users.

·         Description: Give users a description of what this mapping does or what use case it was created for.

·         Salesforce Object: Select a standard object for which you’d like to merge the document with. WebMerge for Salesforce currently supports:

·         Select a WebMerge Resource:  WebMerge allows you to create Documents or Data Routes. You can toggle between both types of resources here. Selecting Documents will give you access to a list of available, active Documents in WebMerge.

·         Select a WebMerge Document (or Route): Select the specific Document or Data Route from WebMerge you’d like to create a mapping for.

·         Run in Test Mode? This option will allow you to test your mapping while you’re designing it without using up your quota of document merges. Documents created in Test Mode have a WebMerge watermark.


Click Save and Next to continue on to Field Mapping.



Creating Field Mappings


Now that we have created a new WebMerge Mapping, we are presented with a series of WebMerge Fields that we can map to existing fields on the Salesforce object that we selected on the previous screen.


Note: Changing a WebMerge Mapping’s Salesforce Object or WebMerge Resource is not currently supported. A new WebMerge Mapping has to be created if you wish to change these values.




Select the Salesforce Field that you want to map to each WebMerge Field. As you are doing this, you will have access to:

·         Fields from the selected Salesforce Object

·         Fields from parent records like Owner, Account, etc.

·         Child Relationships. See Working with Child Relationships for more information on using Child Relationships in your WebMerge documents.




Automatically Generating Documents

With WebMerge you can automatically have a WebMerge Mapping generate a document when specific criteria are met.




Evaluate the following rule when a records is:

·         Created - this will evaluate the rule every single time a record is created. If the rule criteria are met, the document will be created.

·         Created, and every time it’s edited - this will evaluate the rule every single time a record is created and every single time the record is edited. If the rule criteria are met, the document will be created.

·         Created, and any time it’s edited to subsequently meet criteria – this option will evaluate the rule every time a record is created any every time the record is edited and did not previously meet the criteria.


Once you’ve selected the evaluation criteria, you can select up to four criteria that must be met in order for the document to be generated automatically. You have access to the fields on the Salesforce Object that you selected when creating the WebMerge Mapping as well as fields from parent objects like Owner.Name or Account.Name.



Activating and Deactivating WebMerge Mappings

As you build your WebMerge Mapping, you can save it and return to it at any time as you gather requirements and design your document in WebMerge. If you are working with a new mapping, you can Save & Close or Save & Activate. If you choose to Save & Close, you will be able to activate the mapping later.


Activated Mappings

Once you activate a mapping, it will be available to your users through the WebMerge button on a record. If your mapping has been configured to automatically generate documents, those rules will now be active as well.




Adding WebMerge Buttons to Salesforce Page Layouts

Not only do you have the option to setup criteria for generating documents automatically, users can also generate documents on demand using the WebMerge button on a Salesforce record. The objects currently supported by WebMerge are: Account, Case, Contact, Contract,  Lead and Opportunity.

**If you are using a Custom Object or Non-Standard Object, please read this article

View a record from each of these objects and click on Edit Layout in the upper right menu.



Click on the Buttons section and you will see a WebMerge button.




Drag the WebMerge button into the Custom Buttons section of the Page Layout.




Save the Page Layout and you will now see the WebMerge button on the detail record. Repeat this for each of the supported Salesforce objects.






Showing Attachments on Salesforce Records

If you’ve recently started using or have not used the Notes & Attachments feature of the platform, you might not immediately see the documents that are created by WebMerge.


To see all attachments on a record, ensure that the Notes & Attachments related list is added to each of your page layouts. Pull up a record for an object. Click on Customize Page in the upper right.



Make sure that Notes & Attachments is listed under Selected List and click Save.


You will now need to add the Related List to the Page Layout. Click on Edit Layout in the upper right menu.




Click on the Related Lists section and drag the Notes & Attachments Related List into the Page Layout if it is not already there.



Save the Page Layout.


Creating a Document using the WebMerge Button


After you’ve placed the WebMerge buttons and setup a couple WebMerge Mappings, click the WebMerge button on a record. This will show you a list of available mappings for this object.



Click Merge Document next to the mapping you’d like to use with this record.


You will be returned back to your Salesforce record and you should now see your newly generated attachment in the Notes & Attachments Related List.




Advanced Feature: Working with Child Relationships

Salesforce supports master-detail relationships and we’ve given you the ability to use those relationships in WebMerge Mappings.


To use Child Relationships, you will need to create a Smarty Template in your document that supports iterating over a list of data. To do so:


{foreach from=$notes item=note}


In your Salesforce WebMerge Mapping you will now have the ability to map a Salesforce field or relationship to notes and note. When working with child relationships, we’re going to ignore the note field in this situation because it is the iterator. Let’s instead look at notes and in the Salesforce Field section, find the relationship you want to map to the list. In this example, we will use Child Relationship: Notes. This will allow you to create a WebMerge generated document that iterates over all the child notes attached to a Salesforce record and output their Title and Body.


Add Support for Salesforce and Custom Objects

After you’ve logged into WebMerge, click the WebMerge Settings tab.




Here you can add or remove support for various Salesforce objects. We allow you to see a list of all the Salesforce objects that exist within Salesforce but keep in mind that you will only be able to add Merge Buttons and Triggers to certain objects. A good rule of thumb is to stick to standard objects like Quote, Contract, Event, or Task and custom objects.

Adding Merge Buttons for other Salesforce Objects

WebMerge for Salesforce works with a few standard Salesforce Objects out of the box. If you’d like to add more, you can do so.

  • Create a new Visualforce Page
    • Go to Setup > Develop > Pages
    • Click the New button
    • Set the standardController property on the page to be the object you’d like to add support for. Also add the docType and optionally add your own title. In the following example, we are displaying the certificate name. Keep in mind that not every Salesforce object has a Name property.
      <apex:page standardController="Certificate__c" docType="html-5.0" title="Webmerge Certificate: {!Certificate__c.Name}">
          <webm:WebmergeWizard record="{!Certificate__c}" />

  • Create a new button: Set the button type to Visualforce and select your new Visualforce page.
    • Go to Setup > Create > Objects
    • Click on the object you want to create the button for
    • Under the Buttons, Links, and Actions section, click New Button or Link
    • Give the button a name and choose the Content Source to be VisualForce Page, then choose the page you just created

  • Add your new button to a Page Layout
    • Go to the Detail page for your object, and click the Edit Layout link
    • Choose Buttons from the left side and then drag your newly created button onto your layout, and save.

Adding Apex Triggers for other Salesforce Objects

You only need to take this step if you need plan on automatically generating documents when a record is inserted/updated. If you are just clicking the buttons, you don't need to worry about the triggers.

  • Create a new Apex Trigger: Select the Salesforce Object you’d like to trigger on and select After Insert and After Update only. Do not set any other values for this.
  • Add the Apex Trigger code: Add the following code snippet to your new Apex Trigger.
    trigger MyQuoteTrigger on Quote (after insert, after update) { new
        webm.WebmergeTriggerEvaluator(, Trigger.old).doTrigger(); 
Was this article helpful?
2 out of 3 found this helpful



Please sign in to leave a comment.