createContentNote
createContentNote(
connection,input,linkedEntityId):Promise<ContentNoteResult>
Defined in: contentNoteUtils.ts:58
Create one ContentNote and link it to linkedEntityId via ContentDocumentLink.
input.content is base64-encoded here, matching what the ContentNote.Content field expects.
input.createdDate and input.createdByFederationId are only included in the create call when
present — CreatedDate must be an ISO-8601 string (not a numeric timestamp) for the org to accept
it, and CreatedBy.FederationIdentifier attribution requires “Create Audit Fields” to be enabled.
A ContentDocumentLink failure after a successful ContentNote create still reports the created
contentNoteId in its error result (stage: 'link'), so the orphaned note isn’t lost track of.
Parameters
Section titled “Parameters”connection
Section titled “connection”Connection
The org connection to create records on.
The note to create.
linkedEntityId
Section titled “linkedEntityId”string
The Salesforce record ID to link the note to.
Returns
Section titled “Returns”Promise<ContentNoteResult>
The outcome — success with both created IDs, or an error identifying which stage failed.