Help Center Template Editor Create a Contract Template

Create a Contract Template in Salesforce with Dochly

Updated June 2026 11 min read Template Editor
A Salesforce contract template built with Dochly generates accurate, legally structured contracts in one click — pulling party details, commercial terms, and deal-specific data directly from Salesforce records. No copying from CRM into Word. No version confusion. No contracts sitting unsigned in someone's inbox. This guide walks through building a complete contract template: parties section, effective dates, scope of services, commercial terms, conditional clauses, standard legal language, and signature blocks — all connected to live Salesforce data.

What is a Salesforce contract template?

A Salesforce contract template in Dochly is a reusable contract structure stored natively inside Salesforce. It defines every section of your contract — parties, term, scope, commercial terms, legal clauses, and signatures — and populates the dynamic fields automatically from the Opportunity, Account, or Contract record it's generated from.

Unlike a static Word contract that someone updates manually for each deal, a Dochly contract template is connected directly to your CRM data. Generate it once from the right record and every field is accurate — no transcription errors, no outdated pricing, no wrong party names.

Party details from Salesforce

Customer name, address, contact — pulled from Account and Contact records. Your company details are static in the template.

Conditional legal clauses

Liability caps, jurisdiction, payment terms, SLA levels — shown or hidden based on deal type, region, or contract value.

Native e-signature blocks

Both-party signature fields connected to Dochly's native e-signature — no DocuSign, no external platform required.

Triggered by automation

Generate on Opportunity close, approval completion, or stage change — no manual action required from sales or legal.

Audit trail on the record

Every generation, send, open, and signing event logged natively on the Salesforce record — no external dashboard needed.

Stored as Salesforce Files

Signed contracts attach automatically to the originating Opportunity or Contract record — instantly accessible, never lost.


Contract types you can build

The same template creation process works for any contract type. The difference is the primary Salesforce object you select and which conditional clauses you include.

Master Service Agreement (MSA)

Long-form governing agreement covering the entire customer relationship. Usually generated from the Account object. Includes liability, IP, confidentiality, and dispute resolution clauses.

Sales Contract / Order Form

Deal-specific contract generated from an Opportunity. Includes scope, pricing, payment terms, and delivery schedule pulled directly from Opportunity and line item data.

Non-Disclosure Agreement (NDA)

Shorter, simpler contract. Generated from Account or Contact records. Mutual or one-way versions handled by conditional logic — one template covers both.

Statement of Work (SOW)

Project-specific agreement generated from an Opportunity. Includes dynamic deliverables table, milestone schedule, and acceptance criteria — often from Opportunity Products.

Renewal Agreement

Generated from a Contract object nearing renewal date. Pulls existing term, pricing, and scope for review — with updated effective dates and any amended terms.

Vendor / Supplier Agreement

Generated from Account records with Type = Vendor. Includes purchasing terms, delivery requirements, and compliance obligations — different clause set from customer-facing contracts.


Before you build

Contract templates require more preparation than other document types. Before opening the editor, confirm these four things are in place:

Legal review completed

Have your legal team review and approve the contract language before building it into the template. Once published, every generated contract uses this language — making it critical to get it right upfront.

Salesforce fields audited

Confirm all fields your contract needs are present and consistently populated on your Opportunity and Account records. Empty fields generate blank sections — which is worse in a contract than almost any other document type.

Conditional variations mapped

List every variation your contract needs to handle — enterprise vs SMB terms, UK vs US jurisdiction, payment terms by deal type. Each variation becomes a conditional block in the template.

Signatories identified

Know exactly who signs on each side — customer contact, internal approver, legal representative. This determines how many signature blocks you need and what signing order to configure.

Dochly
Available on Salesforce AppExchange Dochly by UTECH HUB — Install Free

100% native Salesforce contract generation & e-signature


Step-by-step: building your contract template

1

Create and name the template

Open the Dochly app in Salesforce. Go to Templates → New Template. Use a clear naming convention — for example "Sales Contract — Enterprise" or "NDA — Mutual". Select the primary object — Opportunity for deal-specific contracts, Account for relationship-level agreements, or Contract for renewal workflows.

See the foundational guide: Create a document template in Salesforce with Dochly

2

Build the contract header

Add your company logo, document title ("SERVICE AGREEMENT", "NON-DISCLOSURE AGREEMENT"), and a reference block in the top-right corner. Contract reference details to include:

Contract Reference: {{Opportunity.Name}}
Date: {{TODAY | date: "MMMM d, yyyy"}}
Version: 1.0

For logo and brand formatting: Build a branded document template

3

Build the parties section

The parties section identifies both contracting entities. Your company information is static; the customer information pulls from Salesforce:

This Agreement is entered into between:

[Your Company Name], a company incorporated under the laws of
[Your Jurisdiction], with its principal place of business at
[Your Address] ("Company")

AND

{{Account.Name}}, with its principal place of business at
{{Account.BillingStreet}}, {{Account.BillingCity}}, {{Account.BillingCountry}} ("Customer")
4

Add effective date and contract term

Contract dates are critical — a blank or incorrect date is a serious contract error. Pull the effective date from the Opportunity and calculate the end date using a formula field or a custom date field:

Effective Date: {{Opportunity.Contract_Start_Date__c | date: "MMMM d, yyyy"}}
Initial Term: {{Opportunity.Contract_Term__c}} months
Expiration Date: {{Opportunity.Contract_End_Date__c | date: "MMMM d, yyyy"}}

If these custom fields don't exist in your org, work with your Salesforce admin to add them before building this section. See adding merge fields for custom field syntax.

5

Add scope of services section

Define what is being delivered under the contract. For product-based contracts, use a dynamic table pulling from Opportunity Products. For service-based contracts, use a combination of static language and merge fields:

Company agrees to provide the following services to Customer:

{REPEAT OpportunityLineItems}
{{OpportunityLineItem.Name}}: {{OpportunityLineItem.Description}}
{END REPEAT}
6

Add commercial terms section

The commercial terms section covers fees, payment schedule, and billing. Pull values directly from the Opportunity to ensure accuracy:

Total Contract Value: {{Opportunity.Amount | currency}}
Payment Terms: {{Opportunity.Payment_Terms__c}}
Billing Frequency: {{Opportunity.Billing_Frequency__c}}
Currency: {{Opportunity.CurrencyIsoCode}}
7

Add conditional clauses

Conditional logic is essential in contract templates — different deal types, deal sizes, regions, and customer segments require different legal terms. This is how one master contract template handles multiple variations:

{IF Opportunity.Amount > 100000}
[Enterprise liability cap and indemnification terms]
{ELSE}
[Standard liability terms]
{END IF}

{IF Account.BillingCountry = "United Kingdom"}
[English law and jurisdiction clause]
{ELSE IF Account.BillingCountry = "Germany"}
[German law and jurisdiction clause]
{ELSE}
[Default jurisdiction clause]
{END IF}

{IF Opportunity.Type = "Renewal"}
[Renewal-specific amendment and continuity clause]
{END IF}
8

Add standard legal clauses

These are static clauses that appear in every contract regardless of deal type. Work with your legal team to finalize the exact language before inserting into the template:

Confidentiality

Non-disclosure obligations for both parties covering information exchanged during the contract term.

Intellectual property

Ownership of deliverables, background IP, and any license grants between the parties.

Termination

Grounds for termination for cause and for convenience, notice periods, and obligations on termination.

Limitation of liability

Cap on each party's total liability and exclusions for consequential or indirect damages.

Entire agreement

Confirmation that this document supersedes all prior agreements, representations, and understandings.

Amendments

Requirement for amendments to be in writing and signed by both parties to be effective.

9

Add the signature block

The signature block must include fields for all required signatories — customer-side and company-side. When connected to Dochly's native e-signature, these become interactive digital signature fields:

For and on behalf of {{Account.Name}}:

Signature: ________________________ Date: ____________
Name: {{Contact.FirstName}} {{Contact.LastName}}
Title: {{Contact.Title}}

For and on behalf of [Your Company Name]:

Signature: ________________________ Date: ____________
Name: {{Opportunity.Owner.Name}}
Title: {{Opportunity.Owner.Title}}
10

Preview, test, and publish

Before publishing, test the contract template thoroughly from multiple real Opportunity records — especially records that trigger different conditional clause branches. Check every merge field, every conditional section, and the signature block formatting.

Test these scenarios specifically:

  • An Opportunity over your liability cap threshold (triggers enterprise clauses)
  • An Opportunity from a UK or EU account (triggers jurisdiction clauses)
  • An Opportunity with a Renewal type (triggers amendment clause)
  • An Opportunity with missing optional fields (no blank "null" text appears)

For troubleshooting output issues: Template editor troubleshooting guide


Connecting your contract template to e-signature

Once your contract template is published, connect it to Dochly's native e-signature so the signing workflow runs entirely inside Salesforce — no external platforms, no manual download and re-upload.

1
Contract generated from Opportunity

Button click or automated Flow trigger generates the contract from live Salesforce data and attaches it to the Opportunity record.

2
Signature request sent to customer contact

The primary contact on the Opportunity receives a secure signing link via email — no external account required to sign.

3
Counter-signature sent to internal approver

After the customer signs, the internal signatory receives the document for counter-signature — sequential signing order configured in Salesforce.

4
Fully executed contract stored on record

The completed, dual-signed contract with full audit trail is stored as a Salesforce File on the Opportunity record automatically. Opportunity stage updates.

For multi-signer contracts requiring parallel or sequential signing — for example, customer signs first, then legal counter-signs — configure signing order directly in Salesforce using the same declarative tools you already know.


Connecting to an approval workflow

For contracts that require internal legal or management review before being sent to the customer, connect contract generation to a Salesforce approval process. This ensures no contract leaves the org without the appropriate sign-off.

Approval process trigger

Set document generation as the final approved action — the contract is generated and sent for customer signature only after the last internal approver grants approval.

Salesforce Flow trigger

Build a Flow that triggers contract generation when the Opportunity stage reaches "Contract Ready" or a custom approval checkbox is checked by the reviewing manager.


Contract template best practices

  • Get legal sign-off before publishing — have your legal team approve all contract language before the template goes live. Treat a published template as a signed-off document, not a draft.
  • Use conditional logic aggressively — one master contract template with conditional clauses is better than maintaining ten separate templates. It reduces errors and makes legal updates faster.
  • Version every update — when legal terms change, create a new template version rather than overwriting. You need to know which version generated which historical contract. See editing and updating templates.
  • Restrict who can edit the template — contract templates contain legal language that should only be modified with legal oversight. Use Salesforce permission sets to restrict template editing access.
  • Require all date fields before generation — add a Salesforce validation rule or Flow check to ensure Contract_Start_Date__c and Contract_End_Date__c are populated before a contract can be generated.
  • Test the signing experience on mobile — many contract signers are executives who sign on their phone. Verify the e-signature experience is smooth on iOS and Android before going live.

Frequently asked questions

Yes. The legal enforceability of a contract depends on its content and the validity of the signatures — not the tool used to generate it. Dochly's native e-signature meets ESIGN/UETA requirements in the US and AES-level eIDAS requirements in Europe. The contract language itself should be reviewed and approved by your legal team.
Yes. Connect contract generation to a Salesforce approval process or Flow condition so the contract is only generated and sent after internal approval is granted. This is the recommended approach for any contract above a deal value threshold or for new customer types.
Yes. Dochly supports multi-signer workflows with sequential or parallel signing order. A typical contract workflow sends to the customer first, then routes to an internal signatory for counter-signature after the customer has signed.
The fully executed contract is stored as a Salesforce File attached to the originating Opportunity or Contract record — with a complete audit trail showing every signing event, timestamp, and IP address. No external storage, no manual download.
Yes. You can edit and update any published template. Always create a new version rather than overwriting the existing one — historical contracts reference the template version they were generated from, and overwriting breaks that audit chain. See the guide on editing and updating existing templates.

Your contract template is ready to generate accurate, legally structured contracts in one click from any Salesforce Opportunity. Next steps: Create an invoice template · Edit and update an existing template · Troubleshooting guide

Dochly
Salesforce AppExchange — UTECH HUB Install Dochly on AppExchange

Rated 5 stars · Native Salesforce app · Free to install