How do I select in a view, documents with responses only? thank you.
Subject: How do I select in a view, documents with responses only?
Two ways. If you really just want the responses, first set the view properties to NOT “Show response documents in hierarchy”. Then for the view selection, either select the documents by SELECT Form = “yourformname” or SELECT @IsResponse.
Subject: RE: How do I select in a view, documents with responses only?
I still don’t get it. What I want is to view documents with response documents in a hierarchy & not view documents without response documents. Thank you.
Subject: RE: How do I select in a view, documents with responses only?
Sorry, Ubendiran. I did not understand the original question. This is not elegant, but it works. I suggest you make an agent that sets a field “NumberChildren” in each parent document, then use that to select only the parent docs that have children.
-
create a view that has ALL docs plus any children (SELECT Form = XXX | @IsResponse )
-
have an agent in LotusScript such as:
Sub Initialize
Dim session As New NotesSession
Dim view As NotesView
Dim doc As NotesDocument
Dim viewentrycollection As NotesViewEntryCollection
Dim viewentry As NotesViewEntry
Set db = session.CurrentDatabase
Set view = db.GetView("XXXXX") 'your view that includes ALL parent docs with their responses
Set viewentrycollection = view.AllEntries
Set viewentry = viewentrycollection.GetFirstEntry
While Not (viewentry Is Nothing)
Set doc = viewentry.Document
If Not doc.HasItem ("$Ref") Then 'only set the field on Parent docs
doc.NumberChildren = viewentry.ChildCount
Call doc.Save (True, True) 'force the save
End If
Set viewentry = viewentrycollection.GetNextEntry (viewentry)
Wend
End Sub
-
Run the agent as frequently as necessary to keep the view you want to show users accurate.
-
Use as the view selection formula for the user view SELECT (Form = XXXX & NumberChildren > 0) | @IsResponse. This will only select parent docs that actually have children.
I have tested this and it will do it. Only problem is that it is not real-time. Agent must determine if children exist with some frequency.
Hope this helps.
Randy