salesforce-appraiser-review.../docs/CLM_TEMPLATE_MAPPING_SNIPPE...

72 lines
2.1 KiB
Markdown

# DocuSign CLM Template Mapping Snippet
This project assumes Salesforce is the system of record and DocuSign CLM doc gen receives a payload built from `Appraiser_Case__c` and its related `Appraiser_Deficiency__c` records.
## Suggested Merge Payload
```json
{
"templateKey": "APPRAISER_REVIEW_LETTER",
"recordId": "a01XXXXXXXXXXXX",
"sourceObject": "Appraiser_Case__c",
"mergeData": {
"appraiserCaseNumber": "AC-000123",
"appraiserFieldReviewDate": "2026-04-01",
"propertyStreet": "123 Main St",
"propertyCity": "Ottawa",
"propertyStateProvince": "ON",
"propertyPostalCode": "K1A 0A1",
"propertyCountry": "Canada",
"propertyAddressSingleLine": "123 Main St | Ottawa, ON, K1A 0A1 | Canada",
"deficiencies": [
{
"deficiencyNumber": "1",
"description": "Missing comparable sale analysis",
"resolution": "Provide updated comparable sales section",
"sortOrder": 1
}
]
}
}
```
## Suggested Template Tokens
Use the actual DocuSign CLM token syntax used in your tenant, but the field model should be equivalent to:
- `{{mergeData.appraiserCaseNumber}}`
- `{{mergeData.appraiserFieldReviewDate}}`
- `{{mergeData.propertyStreet}}`
- `{{mergeData.propertyCity}}`
- `{{mergeData.propertyStateProvince}}`
- `{{mergeData.propertyPostalCode}}`
- `{{mergeData.propertyCountry}}`
- `{{mergeData.propertyAddressSingleLine}}`
### Deficiency Repeat Block
```handlebars
{{#each mergeData.deficiencies}}
| {{deficiencyNumber}} | {{description}} | {{resolution}} |
{{/each}}
```
## Recommended Letter Sections
1. Header / logo block
2. Review metadata
- Case number
- Field review date
- Property address
3. Deficiency table
- Deficiency number
- Description
- Resolution
4. Closing / signature block
## Notes
- Keep `deficiencies` as a repeatable child collection, not a flattened text blob.
- If DocuSign CLM requires a REST callout payload, `AppraiserCaseDocGenService.buildDocGenRequestJson()` is a good source payload to hand to your integration layer.
- If your CLM tenant uses a different collection token syntax, map the same logical field names there.