Solved

Display Only Documents with Responses in a View

Posted on 2004-09-21
12
254 Views
Last Modified: 2013-12-18
How can I write a selection formula that will display only documents in the db that have response docs?
0
Comment
Question by:mcjann
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
12 Comments
 
LVL 19

Expert Comment

by:madheeswar
ID: 12111022
SELECT Form="Formname" & @AllChildren
0
 
LVL 1

Author Comment

by:mcjann
ID: 12111053
I want to see only "FormName" that have a response not all "FormName"
0
 
LVL 19

Expert Comment

by:madheeswar
ID: 12111071
I did not understood what u mean? U want to display only those form docs which have response. RIGHT?

This should work:

SELECT Form="YourFormNAme" | @AllChildren
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:mcjann
ID: 12111117
The database contains 100 documents based on "Form" and 15 of these documents have a response. This formula selects 115 documents when I only want 30 (15 "Forms" each with a single response).
0
 
LVL 19

Expert Comment

by:RanjeetRain
ID: 12111128
USe this:

SELECT Form="Formname" & @DocChildren > 1
0
 
LVL 1

Author Comment

by:mcjann
ID: 12111180
Now I get no documents in the view.
Even when I try @DocChildren=1 or >0
0
 
LVL 19

Expert Comment

by:madheeswar
ID: 12111216
@DocChildren won't work in selection formula.

ur requirement cannnot be achieved.

0
 
LVL 19

Expert Comment

by:madheeswar
ID: 12111237
what u need to do is,
if there is any response document created, update a field in parent and response document as "yes" and make this selection formula in view;
Select form="urformname" & fieldname="yes" | @Allchildren

Since u have already created docs,u need to write some script to update parent and child docs according to above logic and display the result.

Note that there is no striaght forward solution for you.
0
 
LVL 1

Author Comment

by:mcjann
ID: 12111480
madheeswar,

I set the same field on both forms.
The response doc inherets values from the main document.
Field exchange on the main form is not disabled.

I update the field  on the querysave (?) of the response doc.
The field on the response doc updated but the main form did not
Is this becasue the document is not in edit?
The main document should not be edited perhaps a computed field?
0
 
LVL 19

Expert Comment

by:madheeswar
ID: 12111508
Both parent and child documents should have same value.

I mean for all the documents(response and child) should have one data(field) in common and that field should hold a key. we can utilize that field as the key for our view selection formula.

Hoe it helps.

I am leaving office. Will respond tomorrow
0
 
LVL 15

Accepted Solution

by:
Bozzie4 earned 125 total points
ID: 12111595
If you don't want to touch the documents (by adding a field, like maddy suggests ,  which is a perfectly valid solution), you can also create an agent that puts documents with responses in a folder.
To limit the number of documents it works on, you can use the Document Seleciton in the agent

dim db as notesdatabase
dim s as new notessession
dim coll as notesdocumentcollection
set db = s.currentdatabase
Set coll  = db.AllDocuments
do while not doc is nothing
set resp = doc.responses
if resp is nothing then
' skip
Call doc.RemoveFromFolder( "Documents with responses" )
else
Call doc.putinfolder("Documents with responses", true )
end if

set doc = coll.getnextdocument()
loop
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 12112404
Can't do it with a view.  Bozzie's solution will work, though you have to run it regularly, and it will be inefficent when run that way (of course, if you only have a few hundred docs at most, that shluld be OK).

You should also create the folder DOCUMENTS WITH RESPONSES in advance, so you can set the design of it.  Otherwise, the PutInFolder command will create it on the fly, using the default folder design as a guide.

If you want to avoid that, flag the parent documents, but the code is going to be more or less the same.  Instead of doc.putInFolder and doc.removeFromFolder, you would use
        doc.flagAsHavingRespnses = 1
    and
        doc.flagAsHavingRespnses = 0

Then just base you view on flagAsHavingRespnses

In iether case, there will be some lag time between adding a response to a responseless document, or removing all responses from a document, and the time the doc appears in/disappears from the folder or view.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question