Ask the Expert

Move a response doc in a hierarchical view

I'm looking for a way to in an hierarchical view, have a "Move" button to move a response doc (and all its children with out loosing its structure)to a different father doc.


Response documents maintain their relationship with their parent document via the $Ref field. This field contains the DocumentUniqueID of the document to whom this document is a response. Using LotusScript, you can manipulate the parent-children relationships of documents easily.. here is a quick example that will take a response document that is a response to ParentDoc1 and make it instead a response to ParentDoc2. You can make it is complex as you need just as long as you maintain the $Ref field, everything will be fine.

(I have left out some declarations for the sake of brevity, such as thisDB definition, the name should be clear enough)

Dim OldParent, NewParent, ChildDoc as NotesDocument
Dim ParentColl, RespColl as NotesDocumentCollection
Set ParentColl = thisDB.UnProcessedDocuments
Set OldParent = ParentColl.GetFirstDocument
Set NewParent = myView.GetDocumentByKey("WhateverKeyFindsNewParent")
Set RespColl = OldParent.Responses
If RespColl.Count > 0 then
Call RespColl.StampAll("$Ref",NewParent.UniversalID(0))
End If

This was first published in December 2001

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: