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

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: 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.

I don’t think it’s possible to actually set the view selection to find out whether the document has responses or not.

What you could do is set a flag on the parent document when response documents get created, or have an agent that sets the flag, depending on how dynamic it needs to be.

hth

Dan

Subject: RE: 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.

As others have been telling you, you can’t do this with just a view selection formula. There is no @function to tell you whether a document has responses – only whether it is a response.

You could write a LotusScript agent to check each main document and assign a field in that document to tell whether the document has responses. Then you can write a view selection formula that uses that field.

Another way to do it: create a folder instead of a view. Have an agent periodically review all the documents and find out whether they should be in the folder – if so, put them in, if not, take them out. You could also use the Postsave event of the response document to put the parent document into the view, if it’s not already there.

For an example of this approach, see the “Update Failing Students Folder” agent in the sample database you can download here. It doesn’t test whether a document has responses – instead it does a complex test that involves pulling information from many other documents – but it’s easy to instead test whether document.Responses.Count = 0.

Subject: 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.

A view’s selection formula can only select documents based on their contents. That is, each document in the database is considered by the selection formula alone, and you cannot “select” a document based on other documents.

Notes documents don’t “know” if they have a response document. That is, there is no indicator or field you can look at in a document to see if it has a response document or not.

So there’s no out-of-the-box way to code a view to select documents based on the presence or absence of responses.

So in order to do what you need, you will have to code methods so that when you first save a response document a counter is incremented on it’s parent; and when you delete a response document, the parent’s counter is decremented.

Now you can select documents that have a count greater than zero, and know there is response documents for them.