02-13-2013 06:50 PM
I'm trying to copy a note from one document to another in the Unity API. I'm trying this:
(obviously docList is generated from a query that returns the document to copy from)
Dim noteMod as NoteModifier = args.Document.CreateNoteModifier
For Each relDoc as Document in docList
For Each relDocNote as Note in relDoc.Notes
noteMod.AddNote(relDocNote)
Next
Next
noteMod.ApplyChanges()
It throws an error: "Unexpected error: An error occurred within the Unity API: The note# 3413007 was not found on the document# 23079187"
Is this a supported operation? I could create a new note with all the same attributes I guess, but that's quite a bit more tedious.
Thanks!
02-14-2013 04:23 AM
John,
I am changing the Note type on a Document as opposed to copying it from one doc to another. To do that, I have to delete the original note and add the new one after retrieving all of the Note attributes. That works, but it did require a little more effort. This works in a V12 environment. I can send you the code if that helps.
Rich
10-08-2019 08:42 AM
Trying to do the same in V17. I can create the note, but having trouble setting properties like position etc.
09-19-2013 09:36 AM
Hi John -
The note object you are trying to add to the new document is the exact note from the original document, ID and all. That is not supported in the API. When adding the note, you must use the API to create a brand new note to add to the related document.
...
NoteModifier noteModifier = relatedDocument.CreateNoteModifier(); foreach (Note note in document.Notes) { Note newNote = note.NoteType.CreateNote(note.Text); noteModifier.AddNote(newNote); noteModifier.ApplyChanges(); }
...
Thank you,
Alicia
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.