Help Center Document Generation Troubleshooting Generation Errors

Troubleshooting Document Generation Errors in Salesforce

Updated June 2026 10 min read Document Generation
This guide covers every category of document generation error in Dochly — from blank merge fields and failed generation to missing files, Flow trigger failures, batch job errors, and e-signature issues. Each error includes the most likely causes and the specific steps to fix it. If you're contacting Dochly support, the diagnostic checklist at the bottom of this page tells you exactly what information to include for the fastest resolution.

First checks before troubleshooting

Before investigating a specific error, run through these four quick checks. They resolve the majority of generation issues without any further investigation.

Check template status

Go to Dochly → Templates and confirm the template is set to Active. Draft templates cannot generate documents. If it shows Draft, change it to Active and retry.

Check permission set

Confirm the generating user has either the Dochly User or Dochly Admin permission set assigned. Go to Setup → Users → [User] → Permission Set Assignments.

Check the Salesforce record

Open the record being generated from and confirm key fields have values. Empty merge fields in the document almost always mean the field is empty on the record — not a template bug.

Check connection status

Go to Dochly → Settings → Connection Status. If any indicators show red, resolve those connection issues first — they affect all generation attempts until fixed.


Where to find error logs

Before fixing any error, find the error message. Dochly logs generation errors in several places depending on how generation was triggered:

Button click generation

Error messages appear as an inline notification in the generation modal immediately after the attempt. Also visible in Dochly → Activity Log → filter by the record name.

Flow-triggered generation

Salesforce Setup → Flow Error Emails (check your admin inbox), or Setup → Paused and Failed Flow Interviews. Flow errors show the action name and error code.

Batch job failures

Dochly → Batch Jobs → [Job Name] → Failed Records. Each failed record shows an error code and description. Click a record to see the full error detail.

Salesforce debug logs

Setup → Debug Logs → Add trace flag for the generating user. Run the generation. The debug log shows every Apex call, exception, and DML operation during generation.


Generation fails or produces no output

Generation fails with no error message — nothing happens
Symptom: Clicking Generate completes but no document appears and no error is shown.
Most likely causes
  • Template status is Draft — Draft templates cannot generate
  • The generating user lacks the Dochly User permission set
  • Storage destination is not configured in Dochly Settings
  • The Dochly connection has expired — re-run Setup Wizard
How to fix
  • Confirm template status is Active in Dochly → Templates
  • Check the generating user's permission sets in Setup → Users → Permission Set Assignments
  • Go to Dochly → Settings → Document Storage and confirm a destination is configured
  • Check Dochly → Settings → Connection Status — re-run Setup Wizard if any status shows red
Generation fails with an error message
Symptom: An error message appears in the generation modal — e.g. "Generation failed", "Template error", or a specific error code.
Most likely causes
  • A merge field references a field API name that no longer exists (field was renamed or deleted)
  • A REPEAT block references a related list that is inaccessible or empty
  • A conditional block has mismatched IF/END IF tags
  • The template contains unsupported syntax introduced by a manual edit
How to fix
  • Copy the exact error message and search for it in this guide or contact Dochly support
  • Open the template in Draft mode and check for any recently changed or deleted fields in your org
  • Count IF and END IF tags — every IF must have exactly one matching END IF
  • Check the Dochly Activity Log for the full error stack trace
No templates appear in the generation picker
Symptom: Clicking Generate Document shows an empty template list — no templates available to select.
Most likely causes
  • All templates for this object are in Draft status — only Active templates appear
  • Templates exist but are based on a different primary object than the current record's type
  • The generating user's profile doesn't have access to the Dochly templates tab
How to fix
  • Go to Dochly → Templates — confirm there is at least one Active template for this object type
  • Check the template's Primary Object field matches the object type of the record you're generating from
  • Confirm the Dochly User permission set is assigned to the generating user

Blank or missing fields in the document

Merge field outputs blank — nothing appears where data should be
Symptom: The generated document shows empty space where a field value should appear.
Most likely causes
  • The field is genuinely empty on the Salesforce record — the most common cause by far
  • The field API name in the template has a typo — causing silent blank output
  • Field-level security restricts the field for the generating user's profile
  • The related object lookup field is empty (e.g. Opportunity has no linked Account)
How to fix
  • Open the Salesforce record and confirm the field has a value — check the field directly
  • In Setup → Object Manager, verify the exact field API name — it is case-sensitive
  • Check field-level security: Setup → Object Manager → [Object] → Fields → [Field] → Set Field-Level Security
  • Add a default value to handle intentionally blank fields: {{Field.Name | default: "N/A"}}
Raw merge field syntax appears in the document
Symptom: The document literally shows "{{Account.Name}}" instead of the account name.
Most likely causes
  • Merge field was typed manually instead of inserted via the picker — missing a curly brace or has a space
  • Content was pasted from Word or Google Docs which replaced standard curly braces with smart quotes
  • The field API name contains a character error that breaks the syntax parser
How to fix
  • Delete the raw merge field and re-insert using the merge field picker — never type manually
  • If pasted from an external editor, check for smart curly quotes (" ") replacing standard quotes
  • Verify syntax: {{Object.FieldName}} — double curly braces, no spaces, dot separator
"null" appears in the document
Symptom: The word "null" appears in the generated document where a field value should be.
Most likely causes
  • The Salesforce field exists on the record but is explicitly set to null
  • A relationship traversal path leads to a null value (parent record exists but field is null)
How to fix
  • Add a default value to suppress null: {{Field.Name | default: ""}} outputs blank instead of "null"
  • Or wrap in a conditional: {IF Field.Name != null} ... {END IF} hides the section entirely when null

Document not attached to the record

Generation succeeds but no file appears on the record
Symptom: Generation appears to complete without errors but the document doesn't appear in the record's Files related list.
Most likely causes
  • Storage destination in Dochly Settings is not set to "Attach to originating record"
  • The generating user lacks Create access on ContentDocument (Salesforce Files) in their profile
  • The file was generated but attached to a parent record (Account or Contact) rather than the current record
How to fix
  • Check Dochly → Settings → Document Storage — confirm "Attach to originating record" is selected
  • Check the generating user's profile Object Permissions — they need Create on ContentDocument and ContentVersion
  • Check the Files related list on the parent Account or Contact — the file may have been routed there
  • Check the Dochly Activity Log — it shows where the file was stored after generation

Permission and access errors

User cannot see the Generate Document button
Symptom: The Generate Document button doesn't appear on the record page for a specific user.
Most likely causes
  • The user doesn't have the Dochly User or Dochly Admin permission set assigned
  • The button hasn't been added to the page layout for this object
  • The user's profile has a different page layout assignment than the one with the button
How to fix
  • Assign the Dochly User permission set: Setup → Users → [User] → Permission Set Assignments → Edit Assignments
  • Confirm the Generate Document button is on the page layout: Setup → Object Manager → [Object] → Page Layouts
  • Check if the user's profile is assigned a different page layout — add the button to all relevant layouts
Fields populated for admin but blank for standard users
Symptom: The same template generates correctly for an admin but shows blank fields when a sales rep generates it.
Most likely causes
  • Field-level security restricts the blank field for the sales rep's profile — admins bypass FLS by default
  • Object-level read permission is missing for the rep on a related object referenced in the template
How to fix
  • For each blank field: Setup → Object Manager → [Object] → Fields & Relationships → [Field] → Set Field-Level Security → grant Read to the rep's profile
  • For related object access: Setup → Object Manager → [Related Object] → check the rep's profile has at minimum Read object permission

Flow trigger errors

Flow-triggered generation produces no document
Symptom: A Flow that should trigger document generation runs but no document is created on the record.
Most likely causes
  • The Dochly Generate Document action in the Flow is referencing an Inactive or deleted template
  • The Record ID input to the action is not correctly mapped — pointing to the wrong variable
  • The Flow is running but encountering a fault that is silently caught by a fault path
How to fix
  • Open the Flow in Setup → Flows → [Flow Name] — check the Generate Document action and verify the Template ID is pointing to an Active template
  • Confirm the Record ID input is mapped to {!$Record.Id} (for record-triggered Flows) or the correct variable
  • Check Setup → Flow Error Emails — Flow faults are emailed to the admin running the Flow
  • Add a fault path to the Generate Document action that creates a Salesforce task or sends an email when it fails — this makes errors visible

Batch job errors

Batch job completes with some failed records
Symptom: The batch job completion report shows a "Failed" count — some records didn't generate successfully.
Most likely causes
  • Specific records in the batch have missing required field values — the template can't resolve a mandatory merge field
  • Some records in the report have field-level security restrictions for the batch-running user
  • Related object lookups are empty on specific records (e.g. Opportunity has no Account)
How to fix
  • Go to Dochly → Batch Jobs → [Job Name] → Failed Records — review the error message for each failed record
  • For "Field not found" errors: open the specific record and check the field mentioned in the error
  • Fix the data issue on the failed records, then create a new filtered report containing only those records and re-run a targeted batch job
  • Add | default: "" fallbacks to merge fields in the template that may be empty on some records

E-signature errors

Signer doesn't receive the signature request email
Symptom: The signature request was sent but the customer hasn't received the email.
Most likely causes
  • The Contact email address on the Salesforce record is incorrect or empty
  • Salesforce email deliverability is set to "System Email Only" — blocking outbound emails to external recipients
  • The email landed in the signer's spam or junk folder
How to fix
  • Verify the Contact email address on the record is correct and complete
  • Check Salesforce Setup → Email → Deliverability — set to "All Email" if currently on "System Email Only"
  • Ask the signer to check their spam folder and whitelist your Salesforce sending domain
  • Use the Dochly signature tracking panel on the record to resend the request
Signed document doesn't appear on the record after completion
Symptom: All parties have signed but the completed document isn't in the record's Files list.
Most likely causes
  • "Store completed document on record" is not enabled in e-signature settings
  • The generating user lacks Create access on ContentDocument for the post-signature storage
How to fix
  • Go to Dochly → Settings → E-Signature → confirm "Store completed document on record" is enabled
  • Verify the running user has Create access on ContentDocument in their Salesforce profile
  • Download the signed document from the Dochly signature tracking panel as a temporary workaround

Diagnostic checklist — what to check before contacting support

If you've worked through the relevant sections above and the issue persists, use this checklist before contacting Dochly support. Having this information ready significantly speeds up resolution.

  • 1
    Template name and current status (Active / Draft / Inactive)
  • 2
    Salesforce Record ID of the record generation was attempted from
  • 3
    Exact error message from the generation modal, Activity Log, or Flow Error Email
  • 4
    The generating user's Salesforce profile name and which Dochly permission sets are assigned
  • 5
    Whether the issue occurs for all users or only specific profiles
  • 6
    Whether the issue is new (started recently) or has always occurred
  • 7
    Screenshot of the Dochly Connection Status panel (Settings → Connection Status)
  • 8
    For Flow errors: the Flow API name and whether the Flow is active
  • 9
    For batch errors: the batch job name and the error message from the Failed Records list
  • 10
    Any recent Salesforce changes — field renames, profile changes, package updates, or deployments — that may have coincided with the issue starting

Contact Dochly support via the Help Center with the above information. The more context you include, the faster the support team can diagnose and resolve the issue — most issues with a full error message and record ID are resolved in the first response.


Frequently asked questions

Check for recent Salesforce org changes — a field that was renamed or deleted breaks merge fields referencing the old API name. Also check whether a Salesforce deployment was pushed that changed field-level security, whether the Dochly connection needs refreshing, or whether a Salesforce platform release changed any relevant behavior. The Dochly Activity Log shows exactly when errors started, which helps narrow down the change that caused them.
Record-specific failures are almost always caused by missing or unusual data on that specific record. Open the record and check: is the primary Contact linked? Does the Account have all required fields? Are there any related list records (Opportunity Products) if the template expects them? Does the record have any fields with unusual characters or very long text values that might break template rendering?
Use the template Preview function — it generates a document from a real record without storing it as a Salesforce File or triggering any email delivery. Preview is available in the template editor toolbar. Alternatively, create a dedicated test record with known field values and generate from that — delete the generated test files afterward. For Flow testing, use a sandbox org where possible.

If you've worked through this guide and the issue persists, contact Dochly support with the diagnostic checklist information above. Next in this series: Generate documents with Salesforce merge fields with Dochly — the complete merge field reference for document generation.

Dochly
Salesforce AppExchange — UTECH HUB Install Dochly on AppExchange

Rated 5 stars · Native Salesforce app · Free to install