How to find Response Documents if the parent doc. is archived!

Hi Coders.

I’m trying to find all response documents which does not have a parent doc.

During an archive process, a lot of parent documents were archived and most of the response documents as required, for some reason it did not work on all docs. we have X number of response documents without a parent document an no idea on how to find them.

I would like these response documents without a parent documents shown in a view so I can decide whether or not they should be archived.

Any ideas on how to go about that – not using script, I guess the $Ref is the key to finding them but how?

Help much appreciated.

Regards, Mike

Subject: How to find Response Documents if the parent doc. is archived!

'//Trying to get parent docSet parentDoc = database.GetDocumentByUNID( childDoc.GetItemValue(“$REF”)(0) )

'//Check parent doc

If parentDoc Is Nothing or Not parentDoc.IsValid Then

'//Add child to folder

call childDoc.PutInFolder( "YourFolderName" )

End if

Subject: RE: How to find Response Documents if the parent doc. is archived!

Hi Marco.

Thanks for the reply. How do I execute this code?

Brgds, Mike

Subject: RE: How to find Response Documents if the parent doc. is archived!

Here we go…

Create an agent (LotusScript) with the properties:

  • runs from the actions menu

  • target=none

Code:

Dim s as new notessession

set docCol = s.currentdatabase.search({Form=“YourChildDocFormName”},nothing,0)

Print “Checking " + cstr(docCol.count) + " docs…”

set childDoc = docCol.getfirstdocument()

while not childDoc is nothing

'//Trying to get parent doc

Set parentDoc = s.currentdatabase.GetDocumentByUNID( childDoc.GetItemValue(“$REF”)(0) )

'//Check parent doc

If parentDoc Is Nothing or Not parentDoc.IsValid Then

'//Add child to folder

call childDoc.PutInFolder( “YourFolderName” )

End if

set childDoc = docCol.getNextDocument(childDoc)

wend

msgbox “Finished!”