I apologise in advance if this has been answered elsewhere, I looked but didn’t find it - some very similar but…
I am copying documents & their responses from one database to another using NotesDocument.copytodatabase(db). This works fine & even creates the right $Refs. The views show things in a response hierarchy & everything is hunky dory.
The code runs again and the reponse documents are updated. They no longer show correctly in the view and after a lot of faffing around I deduced that this could be because the ParentDocumentUNID is no longer valid. And no I don’t mess with it in the code.
Subject: RE: ParentDocumentUnid breaks when document updated
I’m actually surprised to hear that the initial copy works. I would have thought you’d have to use MakeResponse to link the copied responses to their copied parents.
The phrase “the response documents are updated” is extremely vague. Since that’s the part that’s causing whatever’s going wrong, you might want to provide more detail there.
Subject: RE: ParentDocumentUnid breaks when document updated
Yo have to do this because when you copied the documents to the new database, the ParentDocumentUNID changed, so the reference is lost. By using Notesdocument.makeResponse(ParentDocument), you restablish the link.
It’s a mistake to raise a new issue when closing a thread.
If you see an error in the Notes documentation, the best and most efficient way to get it corrected, is to click the Feedback link which appears on every help page. Someone looks at every one of those comments. If you state clearly what you see that’s wrong, why it’s wrong, and what the correct information is, it stands an excellent chance of getting corrected.