Chapter 02
A case to run it on
The engine needs somewhere to run from. A tiny single-screen case gives it fields to read, a property to hold the finished HTML and a view to show it in.
Pega 24 – 26
Words you will meet
- Case type
- Text (Long)
- Rich Text Editor
Phase 2 · Step 4
Create a single-screen case type.
- App Studio →
Case types → + New. - Name it
Payment Reminder. - Keep the default single stage and single step.
- Add the following fields:
| Field name | Type | Purpose |
|---|---|---|
| CustomerName | Text | Used in the salutation and address |
| AmountDue | Currency | Amount shown in the reminder body |
| MembershipLevel | Text (Picklist: STANDARD, GOLD) | Controls which paragraph shows |
| PlanType | Text (Picklist: PAY_NOW, INSTALMENTS, HOLD) | Controls which of three body paragraphs shows, in the later chapter on variants |
The field names, picklist values and sample text in this guide are illustrative, so use your own where you like.
Phase 2 · Step 5
A property for the HTML.
The engine hands back one finished piece of HTML. You need a property to catch it.
- In Dev Studio, open your work class:
MyApp-Work-PaymentReminder. - Go to
Data model → + Add property. - Name it
LetterHTML(or any name you prefer). - Type:
Text (Long).
Phase 2 · Step 6
A place to show it.
A Rich Text Editor is the control that draws HTML as a formatted letter instead of showing the tags.
- Open the Constellation view for your case step.
- Drag a
Rich Text Editorcomponent onto the canvas. - Bind its property to
.LetterHTML. - Set it to Read-Only (or editable, if users need to amend the letter before sending).
Your turn
Questions and comments
Stuck on something, or have a thought? Write it here. To talk about one part, use the Comment button under that section's heading.