salesforce-appraiser-review.../docs/CLM_TEMPLATE_GUIDE.md

90 lines
2.3 KiB
Markdown

# CLM Template Guide — Appraiser Review Letter
## Overview
This guide explains how to structure, configure, and manage Appraiser Review Letter templates within Salesforce CLM. It covers:
- Repeat/array merge tags
- Conditional visibility (show/hide questions, sections, deficiencies)
- Table and paragraph formatting
- Edge cases (null values, formatting challenges, deficiencies)
- Example usage patterns
- Decision and action points (explicit issues or questions to resolve)
---
## Merge Tag Techniques
- Table/block repeats: {{#reviewQuestions}} ... {{/reviewQuestions}}
- Paragraphs vs. tables, hiding/showing blocks
## Common Scenarios
- Including only answered questions
- Conditional: show deficiency section/flag if relevant
## Repeat/Array Tags
### Usage Example:
```handlebars
{{#each DeficiencyList}}
<tr>
<td>{{DeficiencyType}}</td>
<td>{{DeficiencyDescription}}</td>
</tr>
{{/each}}
```
- Use `each` blocks to render dynamic content (arrays/lists from Salesforce).
- Supports variable-length tables and grouped paragraphs.
## Conditional Sections
Example:
```handlebars
{{#if IsDeficiency}}
Section: Deficiencies Found
{{else}}
Section: No Deficiencies
{{/if}}
```
- Show/hide based on merge fields (boolean or enumerated).
- Can target entire sections, paragraphs, or individual questions.
## Table/Paragraph Examples
**Deficiency Table:**
```html
<table>
<thead>
<tr><th>Type</th><th>Description</th></tr>
</thead>
<tbody>
<!-- Dynamic rows go here -->
{{#each DeficiencyList}}
<tr><td>{{DeficiencyType}}</td><td>{{DeficiencyDescription}}</td></tr>
{{/each}}
</tbody>
</table>
```
**Paragraph Blocks:**
```handlebars
{{#each Comments}}
<p>{{CommentText}}</p>
{{/each}}
```
## Edge Case Handling
- If `DeficiencyList` is empty/null, render a fallback paragraph: `No deficiencies found.`
- Fields may be string, number, or boolean—always sanitize output in template.
- Format sections to avoid unwanted whitespace/empty tables.
## Questions to Clarify
- What is the complete list of merge fields expected for each template?
- Are custom data transformations needed before merge?
- Are any fields multi-select or nested objects?
- How are null/empty values handled (leave blank vs. explicit text)?
---
_Last updated: 2026-02-26 10:32 AM_
_Work in progress: More examples and Salesforce integration notes coming next._