# Fix DocuSign CLM "merge field not found" on document generation

## TL;DR
The document generation template references a merge field whose name doesn't match anything in the data source, usually because the source field was renamed, deleted, or the integration user lost access to it. Compare the failing merge field against the source field's exact API name character for character, update the template mapping, and regenerate.

```text
merge field not found
```

## Steps
1. Open the document generation template and note the exact merge field name that failed.
   Expected: the literal field reference from the template.
2. Check the source record (for example, the Salesforce object) for a field with that exact API name, and confirm the integration user can read it.
   Expected: you find a rename, a deleted field, or a field-level permission gap.
3. Update the template's merge field to the correct API name, including the relationship path for fields on related objects.
   Expected: the mapping validates in the template editor.
4. Regenerate the document.
   Expected: generation succeeds with values merged into the document.

## Use this when
- DocuSign CLM document generation fails with "merge field not found"
- Generation broke after a Salesforce admin renamed or removed fields
- A template works for one record type but fails for another

## Not for this skill when
- Generation succeeds but values are blank (that's a data problem, not a mapping problem)
- The error is about the template file itself (that's a template problem)
- You're merging from a non-Salesforce source (the concept transfers, but field lookup steps differ)

## Variant phrasings
### docusign clm document generation merge field error
Check the field mapping before rebuilding the template.
### springcm merge field not found
DocuSign CLM was SpringCM; the merge engine behavior is the same.
### clm template field renamed salesforce
Renames break the binding silently until generation time; search the template for the old API name.

## Why it happens
Merge fields bind by exact API name at generation time. Salesforce admins rename fields, delete unused ones, or tighten field-level security, and the template keeps referencing the old name. Nothing validates the mapping until a generation run hits it, so the breakage surfaces late.

## Edge cases
- Field names are case-sensitive; "AccountNumber" and "accountnumber" are different fields.
- Fields on related objects need the full relationship path, not just the field name.
- Test template changes against sandbox records before running production generations.
- Managed-package fields have namespace prefixes; dropping the prefix breaks the binding.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_WQs9OIu2uww5yws1Fz3Ktw
