Skip to main content
Build the future with Agentforce at TDX in San Francisco or on Salesforce+ on March 5–6. Register now.

Create Web Document Templates

Learning Objectives 

After completing this unit, you’ll be able to:

  • List the types of document templates you can create.
  • Create a web document template using Document Template Designer.
  • Describe the document template sections.
Note

Prerequisites

Before you start this module, ensure that the required prerequisites are met. Also consider the recommended prerequisites to best prepare you to learn.

Required

Complete the module Industries Document Generation Foundations to understand benefits of using document generation to meet business challenges.

Recommended

Document Generation at Infiwave

In the Industries Document Generation Foundations module, you saw how Infiwave simplified and expedited the sales process with digital document generation. Led by Sophia Perez, sales manager, the sales team can now whip up business-critical documents with speed, precision, consistency, and accuracy.

Sophia, a sales manager at Infiwave

Document templates define the structure, content, and formatting of documents. In this module, you examine how Infiwave set up its Industries Document Generation solution, namely the quote, proposal, and contract document templates the team members use daily. 

Who helped set up the logic required to implement and maintain the Document Generation solution? Enter Felix Davis Rosenberg, the trusty Salesforce administrator at Infiwave.

Head shot of Felix, Salesforce admin at Infiwave

Let’s learn how Felix set up the templates and configured the supporting document-generation processes. But first, let’s find out about templates and template types.

Templates and Template Types

Document templates can be as simple or sophisticated as needed, as long as they help optimize the business process. Template creation is the first project to tackle when setting up a document-generation solution. 

How can you create templates with Industries Document Generation? Use the Document Template Designer to build three types of templates: Web HTML, Microsoft Word .docx, and Microsoft PowerPoint .pptx. When you design a template, you can include standard, conditional, and dynamic elements. This way, when the end-user generates a new document from the template, a lot of the content is already populated.

You can also combine standard content with tokens and display conditions. For example, quote documents may require standard elements, like the company name, logo, and details. They can also require dynamic elements, such as the customer’s chosen product and features, along with a quoted price. For some types of documents, you may want to show certain sections under specific conditions.

Data Mapping Types

Each type of template uses JSON-based data mapping. Web templates can use object-based data mapping as well. This diagram shows the template types and data mappings.

A component diagram displaying the three types of document templates and their corresponding data mappings

You can design two types of templates based on how token mapping occurs.

  • JSON-based
  • Object-based

JSON-based data mapping is available for each template type. This mapping allows you to define a document template and then use it to generate documents by merging data from any source, such as OmniScript or an external system. You can either use a Data Mapper to map JSON-based tokens to JSON data or a custom Apex class to extract or transform data.

Object-based data mapping is currently available for Web HTML templates. An object-based template is easier to build than a JSON-based template, but it is less flexible in terms of the documents it can generate. This mapping is primarily used for contracts rather than opportunities, quotes, or orders. It allows you to map tokens directly to the SFDC object field. You can select applicable SFDC object data as input, and merge data from these objects into document sections to produce the final document.

Reusable Clauses

A clause is a text-based building block in a contract that provides approved legal language and provisions defined for your organization. Clauses typically specify terms and conditions or other legal statements required in contracts. Find predefined, reusable clauses in the Clause Library or you can create new clauses.

Web Document Templates

Sophia’s team needs an HTML-based contract document template that’s easy to use and customize, has no strict formatting, and doesn’t require a plug-in tool. To this end, Felix designs a web template. These are also called web document templates or web HTML templates.

When you design a web template, you can use CLM features, such as redlining and online version comparison. Use the clause library to find standard, reusable clauses. In addition, you can embed other templates in your new template.

Web document templates can include various sections to hold specific types of content, including, context, images, clauses, signatures, and even embedded templates. For example, a contract document may need a company logo, name, details, payment terms, signature, and a list of products with prices.

Click the section types to learn more.

Clause Creation

Sophia needs to include payment terms in all the contract documents, so Felix creates a reusable, text-based payment clause to use across document templates.

Here’s an example of payment terms with a non-formatted clause.

Vlocity Document Clause UI displaying fields such as Name, Category, Language, and Clause Content

Follow the steps to create a clause.

  1. Go to App Launcher, and open Vlocity Document Clauses.
  2. Click New.
  3. Enter a Name (1) for the clause, for example, Payment Terms.
  4. Select a Category (2), for example, Services.
  5. Select a Language (3), for example, English.
  6. Enter the Clause Content (4).
  7. Select All Contract Types (5). This allows the clause in all contract types.
  8. Click Save.

Web Document Template Creation

Let’s create a web document template in the Document Template Designer.

  1. Go to the App Launcher, and open Document Template Designer.
  2. Click New. The Start New Template window opens.Document Template Designer UI for creating web document template displaying the template settings
  3. Enter a Name for the template, for example, Telecom Services Agreement.
  4. For Template Type, select Vlocity Web Template.
  5. For Language, select English.
  6. For Token Mapping, select Object Based.
  7. For Usage Type, select Contract.
  8. For Applicable Objects, select Contract, and for Applicable Item Types, choose ContractLineItem__c.
  9. Click Save Template Details.

Template Sections

A web document template is an assembly of sections that you arrange in the order that you want them to appear in the resulting document.

Here’s how to create a document section.

  1. In the Document Template Designer, click Add New Section.Web document template designer UI to add a section type
  2. Choose a Section Type.

For the Telecom Services Agreement template, Felix requires various sections like Image, Clause, Item, Embedded Template, and Signature. Let’s learn how to add each section type.

Image

From the Image section type, click Insert Image to upload an image.

Insert image in the Image Section Type in the contract document.

Felix adds the Infiwave logo to the template.

Clause

The list of available clauses is displayed. These are the clauses from the Clause Library.

Web document template designer UI to add payment terms clause in document sections

Felix adds the Payment Terms clause from the clause library.

Define Clause section to display clause in the contract document.

The clause text becomes part of the new template.

Item

Items are products or services to include in the contract, such as broadband cable service, installation, or an office internet solution.

Define Item section to display items in the contract document.

To add items, click Add Column. The quantity is displayed in tabular format.

Felix creates tokens and maps them to the respective fields.

Embedded Template

To embed an existing template in your new template, click Add New Section. Then select Embedded Template. Only active web templates are listed.

Web document template designer UI to add telecom Fees & Payments template in document sections

Felix embeds the Telecom Fees & Payments template.

Define Embedded section in the contract document.A new section with Fees & Payments is added to the template.

Signature

Use a Signature section to define a signature block and insert tags into the block. 

The Define Signature section in the web document template

You can add a table as shown in the image or you can just add text using tokens. Felix adds this section as the last section of the contract document. 

CLM integrates with DocuSign to manage the eSignature flow. DocuSign recognizes the tags when you send the generated documents to manage the eSignature process.

When you’re finished adding sections, click Save Template Details.

With all these sections added, the web document template is ready.

Resources 

Comparta sus comentarios sobre Trailhead en la Ayuda de Salesforce.

Nos encantaría conocer su experiencia con Trailhead. Ahora puede acceder al nuevo formulario de comentarios cuando quiera desde el sitio de la Ayuda de Salesforce.

Más información Continuar para compartir comentarios