# GetClaimNotes - Advanced Documentation ## Overview Retrieves all notes attached to a claim. Notes can be very large (hundreds of entries, megabytes of text). The claim itself (`GetClaim`) does not include notes; call this when notes are needed. ## Script Patterns Notes can be large. Always filter or summarize before returning to the user. ```javascript async () => { const notes = await SecureApi.GetClaimNotes(771360); // Filter to recent notes const thirtyDaysAgo = new Date(); thirtyDaysAgo.setDate(thirtyDaysAgo.getDate() - 30); const recent = notes.filter(n => new Date(n.CreatedDate) > thirtyDaysAgo); // Summarize - don't return full text of all notes return { totalNotes: notes.length, recentCount: recent.length, recentNotes: recent.map(n => ({ id: n.ID, date: n.CreatedDate, author: n.CreatedByIDName, type: n.Type?.Name, preview: (n.Note || "").substring(0, 200) })) }; } ``` ## Cross-References | Need | Use Instead | |------|-------------| | Claim data without notes | `GetClaim(ClaimID)` | | Create or update a note (ID 0 creates) | `SaveClaimNote(NoteInfo)` | | Delete a note | `DeleteClaimNote(NoteInfo)` |