Manage Learn to apply best practices and optimize your operations.

Hide Main Topic Document in a Discussion DB Until Response Is Created

In our version of a discussion database, Main Topics are questions and all responses (the answers) are created by the "authority" on the topic. While the database uses a standard discussion template, it is really more like an FAQ database than a discussion. Since our purpose is to show questions with answers, we did not want to show the Main Topic documents (the questions) until there was a Response document (the authoritative answer).

To accomplish this, the "authorities" who create responses have the role "[Responders]" assigned in the database ACL. "[Responders]" is the default value of "HideIfNoResponse," a readers field on the Main Topic form.

Default access for the database is set to Author (so anyone can write questions) with the role "[ReadFAQs] assigned."

When a Response document is submitted by an "Authority," the WebQuerySave event runs the following agent which replaces the role "[Responders]" with the role "[ReadFAQs]."

The readers field roles make documents "invisible" to all but "Authorities" until a Response document is created. Then they appear in views for all readers.


Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView

Dim ResponseDoc As NotesDocument
Dim MainDoc As NotesDocument

Set db = session.CurrentDatabase
Set view = db.GetView("Parent Lookup") ?a view with a sorted first column

?@Text(@DocumentUniqueID), used as a lookup key.
Set ResponseDoc = session.DocumentContext 'returns the backend NotesDocument being displayed by the Web Browser
Set MainDoc = view.GetDocumentByKey (ResponseDoc.Parentdocumentunid,True)
Call MainDoc.ReplaceItemValue("HideIfNoResponse","[ReadFAQs]")

Call MainDoc.Save (True,True)

End Sub

This was last published in November 2000

Dig Deeper on Domino Resources - Part 8

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close