For the complete documentation index, see llms.txt. This page is also available as Markdown.

Customize Template Settings: Document Generation

Configure page layout, file naming, and file save behavior for a quote template.

Use this tutorial when you want one template to generate a polished quote with consistent layout and file handling.

What it looks like

After setup, one generated quote gives the user all of this:

  • A PDF with a consistent file name, such as Quote-Acme Corporation-2026-04-09.pdf

  • A Salesforce File linked to the Opportunity

  • Page spacing that leaves room for company letterhead

This is the right end state for quote, invoice, and renewal templates that need predictable output.

When to use template settings

Use template settings when you need predictable output from one template.

Best for:

  • Quote templates with fixed page layout and file naming

  • Invoice templates that should save as Salesforce Files

  • Renewal or contract templates with consistent output formatting

Use another feature when the problem is different:

Configure template settings for a quote template

What you'll configure

  • Custom page margins for letterhead

  • An automatic output file name

  • Automatic file save behavior

Estimated time: 15 minutes

Prerequisites

Before starting, make sure you have:

  • An existing S-Docs template

  • The template's Related To Type set to Opportunity

  • Permission to edit S-Docs templates

  • At least one Opportunity with an Account and line items for testing

  • Basic familiarity with merge field syntax

If you do not have a starter template yet, create a simple one first.

1

Step 1: Open the template editor

  1. Go to S-Docs Templates in Salesforce.

  2. Open your quote template.

  3. Click Edit Template.

  4. Confirm the editor shows tabs such as Page Settings, Document Options, and Email Settings.

You are now in the screen where all template settings live.

2

Step 2: Set page margins for letterhead

Use custom margins when your company header is already printed or built into the design.

  1. Open Page Settings.

  2. Set Page Layout to Custom.

  3. Enter these values:

    • Page Width: 8.5

    • Page Height: 11

    • Top Margin: 2

    • Bottom Margin: 1

    • Left Margin: 0.75

    • Right Margin: 0.75

    • Unit: inches

This leaves extra room at the top and keeps body content readable.

3

Step 3: Set the output file name

This controls the file name users see in Salesforce and email attachments.

  1. Open Document Options.

  2. Find Attachment & File Name Options.

  3. In Output File Format, enter:

A generated file now follows one consistent pattern.

Example output: Quote-Acme Corporation-2026-04-09.pdf

Use single-brace merge fields like {!Opportunity.Name} in settings tabs. Use double-brace merge fields like {{!Opportunity.Name}} in the template body.

4

Step 4: Save the generated document as a Salesforce File

This keeps each generated quote attached to the source record.

  1. Stay in Document Options.

  2. Under Attachment & File Options, enable Create Salesforce File and link to record.

  3. Leave Delete related Salesforce Attachment/File upon S-Doc deletion enabled.

Each generated quote now appears in the record's Files related list.

Save the template after Step 4. Then generate one test document.

Verify these results:

  • The file name matches your expected pattern.

  • The quote appears in Files.

  • The top margin leaves room for letterhead.

Guardrails and limits

Merge field rules

  • Use single braces in settings tabs.

  • If you mix syntax or casing, values can print as raw text or stay blank.

File behavior

  • Enable Salesforce Files in your org if your team saves generated documents there.

  • Expect the generated file to link back to the source record when file creation is enabled.

Testing rules

  • Test with an Opportunity that already has real account data.

  • Generate a fresh document after each settings change.

  • Verify the file name, Files related list, and page spacing every time.

  • If you skip testing, layout and file issues usually surface only after users generate live documents.

Last updated

Was this helpful?