Copy a response note (and its parent) using CAPI

I am trying to copy a repeat appointment which contain 1 parent note and 1 child note using C API.

I was able to copy the content of the parent and child note (using the sample code from CAPI).

However, I was not able to “fixup” the parent-child relationship via _NOTE_RESPONSE_COUNT, $REF, _NOTE_PARENT_NOTEID etc. even though I called NSFNoteSetInfo successfully for those item. In fact most of these call doesn’t affect the new copy of the note.

It there something special I need to change in the new child (& parent) to make a perfect new copy of the recurring appt?

=====

code:

copyRecurringNote()

{

NOTEHANDLE hParent = ...

NOTEHANDLE hChild = ...



copySingleNote(hParent);

copySingleNote(hChild);



// call NSFNoteSetInfo to fixup the _NOTE_RESPONSE_COUNT, $REF,  _NOTE_PARENT_NOTEID

...; // doesn't change a thing to hParent & hChild?!?!

}

copySingleNote(NOTEHANDLE hTargetNote)

{

// similar to what the sample does, skip error checking code...

NSFNoteCopy(hTargetNote, &hNote);

NSFDbGenerateOID(hDB, oid);

NSFNoteSetInfo(hNote, _NOTE_OID, &oid);

NSFNoteSetInfo(hNote, _NOTE_ID, NULL);

NSFNoteSetInfo(hNote, _NOTE_DB, &hDB);

NSFNoteUpdate(hNote, UPDATE_FORCE);

NSFNoteGetInfo)(hNote, _NOTE_ID, &nid);

   

...

}

Arnold

Subject: Copy a response note (and its parent) using CAPI

i’m a bit confused. am i right that you successfully managed to copy these to notes?

do you copy it into same-database?

there’s an example about how to make one note a response to another: MISC\RESPONSE.

i think you missed to post that stuff or i don’t see it.

maybe there’s just one missing NSFNoteUpdate?

Markus Seitz

markus.seitz@icodex.com