View selection formula with ResponsetoResponse form

Hi All

I’ve a ResponseToResponse form with ProductionApprovalSubmitted, WorkApprovalSubmitted and ISReviewApprovalSubmitted fields with default value is No,

and now I want to select those main doc where ISStaus is not closed and ResponseToResponse form where fields ProductionApprovalSubmitted, WorkApprovalSubmitted and ISReviewApprovalSubmitted except value No.

I tried following but it still show me the ResponseToResponse form with ProductionApprovalSubmitted, WorkApprovalSubmitted and ISReviewApprovalSubmitted fields with default value is No

SELECT( ISStatus != “Closed” ) & ((ProductionApprovalSubmitted !=“No”) : (WorkApprovalSubmitted !=“No”) : (ISReviewApprovalSubmitted !=“No”)) | @AllDescendants

Thanks for help

Subject: View selection formula with ResponsetoResponse form

For

SELECT( ISStatus != “Closed” ) & ((ProductionApprovalSubmitted !=“No”) : (WorkApprovalSubmitted !=“No”) : (ISReviewApprovalSubmitted !=“No”)) | @AllDescendants

I assume ProductionApprovalSubmitted and WorkApprovalSubmitted are only on the response documents and not on the parent document?

If that’s the case you saying give me all documents (parent) with ISStatus != “Closed” (and Desecendants)

Given ProductionApprovalSubmitted and WorkApprovalSubmitted do not exist they do NOT equal No.

My attempt at a solution/work around:

Add ProductionApprovalSubmitted and WorkApprovalSubmitted to the parent document. Then when they are set to Yes on the Response to response document, you also set the value on the (top) parent document. Then your selection formula will work.

Subject: RE: View selection formula with ResponsetoResponse form

Hi Stephen

ProductionApprovalSubmitted and WorkApprovalSubmitted fields are on the ResponseToResponse document.

If I copy ProductionApprovalSubmitted and WorkApprovalSubmitted fields on parent form, how I set there values base on the value on ResponseToResponse form.

Thanks for the help

Subject: RE: View selection formula with ResponsetoResponse form

As responses to responses can be many levels deep you need to iterate until you have the main document. Use something like this in the onSubmit or QuerySave event on the response to response document

Dim session as new notessession

Dim ws as new notesuiworkspace

Dim db as notesdatabase

Dim doc as notesdocument

Dim parentdoc as notesdocument

Dim parentUnid As String

Set db = session.currentdatabase

Set doc =ws.currentdocument.document

parentUnid = doc.ParentDocumentUNID

if parentUnid = “” then

'parent document must of been deleted so do nothing

exit sub

end if

while not parentUnid = “”

set parentdoc = db.GetDocumentByUnid(parentUnid)

parentUnid = parentdoc.ParentDocumentUNID

wend

'got main document now copy values across

parentdoc.ProductionApprovalSubmitted = doc.ProductionApprovalSubmitted(0)

parentdoc.WorkApprovalSubmitted = doc.WorkApprovalSubmitted(0)

Call parentdoc.Save(True, False)