# CreateClaimNote - Advanced Documentation ## Overview Creates a new note on a claim with support for embedded images and cross-claim note sharing. This is the only way to create notes - notes cannot be created through `SaveClaim`. ## Required Fields - **ParentID** (long) - ClaimID the note belongs to. Must be >= 1. - **Note** (string) - The note text content. - **Type** (LookupInfo) - Note type with valid ID. The note type must belong to the claim's firm. Use the claim's available note types. ## Optional Fields - **SendToAssociatedClaims** (bool) - If true, creates a copy of this note on ALL other claims in the same ClaimGroup. Useful for group-wide updates. ## What Gets Set Automatically - **CreatedByID** - Set to the current person - **CreatedDate** - Set to current UTC time - **CreatedByPicture** - Set from the current person's photo - **ImageStorageRoot** - New GUID generated for image storage ## Image Handling Notes support embedded images stored in AWS S3: - Images are uploaded to S3 under the note's `ImageStorageRoot` path - If the note save fails after images are uploaded, the images are rolled back (deleted from S3) - Image references in the note text point to the S3 storage location ## Side Effects - Creates ClaimNote record in database - If `SendToAssociatedClaims = true`: creates notes on all grouped claims - Triggers JSON re-serialization for the claim - Updates last review dates on the claim - Uploads any embedded images to AWS S3 ## Script Example ```javascript async () => { const note = { ParentID: 771360, Note: "Called insurance adjuster. Waiting on response for medical records.", Type: { ID: 1 } }; const result = await SecureApi.CreateClaimNote(note); return { id: result.ID, created: result.CreatedDate }; } ``` ## Error Conditions - `ParentID < 1` - throws exception - Claim not found - throws exception - Note type not valid for the claim's firm - throws exception - Claim belongs to a different firm - throws exception