Lotus Notes view selection formula

15 pts.
Tags:
Domino Designer
Domino Designer Form Field Data
Lotus Domino
Lotus Notes
Lotus Notes Formulas
I want to select main documents which contains response documents with field value voltage1=6000. I tried with: SELECT form="Main" | (@IsResponseDoc & voltage1=6000) But result is null. What is wrong in this formula? PS. field voltage1 is located on the response document
ASKED: January 17, 2011  11:36 AM
UPDATED: January 20, 2011  8:04 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

if you want to remove the main doc which don’t have any child matching voltage1=6000, then you have to have a field in the main doc, I believe.
I don’t know any way to select a document based on the value from one of its children field.
You can set the parent field value with the PostSave event of the children for instance put all the possible values of voltage1 from the children in the field.
if the field in the parent doc is Voltage1List :
Sub Postsave(Source As Notesuidocument)
Dim db As notesdatabase
Dim parent As NotesDocument
Dim v As Variant
Set db = source.Document.ParentDatabase
Set parent = db.GetDocumentByUNID(Cstr(Source.Document.ParentDocumentUNID))
Set field = parent.GetFirstItem(”Voltage1List”)
v = parent.Voltage1List
i = Ubound(v) +1
Redim Preserve v(i + Ubound(source.Document.GetItemValue(”Voltage1″)))
Forall values In source.Document.GetItemValue(”Voltage1″)
v(i) = values
i = i + 1
End Forall
parent.Voltage1List = Fulltrim(Arrayunique(v))
Call parent.Save(True,False)
continue = True
End Sub

The view formula is then “SELECT Form=Main & @contains(Voltage1List;”6000″)”
or “SELECT (Form=Main & @contains(Voltage1List;”6000″)) | voltage1=”6000″” if you wish to restrcit the children displayed to the ones that match voltage1=”6000″ or … if …

if your application is to be used through web, you could do it the other way around.
you make the responses doc inherit some fields from the parent’s doc.
in your view you select only the response doc making sure to categorize them by the inherited field and alter the column to display a link to the main doc.
This way you can open the main document. I can’t imagine a way to have the same behaviour in Notes. XPages maybe.

Discuss This Question: 6  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • SinisaMalesevic
    No, that is not solution. I that case you will get all documents from "Main " form, I wont to make filter by value in response form
    15 pointsBadges:
    report
  • Gsplmgc
    Do you have 'Show resopnse documents in a Hierarchy' checked on?
    70 pointsBadges:
    report
  • Ppolette
    Arf, misunderstood, sorry. Then you have to have a field in the main doc, I guess. I don't know any way to select a document based on the value from one of its children field. You can set the parent field value with the PostSave event of the children for instance put all the possible values of voltage1 from the children in the field. if the field in the parent doc is Voltage1List : Sub Postsave(Source As Notesuidocument) Dim db As notesdatabase Dim parent As NotesDocument Dim v As Variant Set db = source.Document.ParentDatabase Set parent = db.GetDocumentByUNID(Cstr(Source.Document.ParentDocumentUNID)) Set field = parent.GetFirstItem("Voltage1List") v = parent.Voltage1List i = Ubound(v) +1 Redim Preserve v(i + Ubound(source.Document.GetItemValue("Voltage1"))) Forall values In source.Document.GetItemValue("Voltage1") v(i) = values i = i + 1 End Forall parent.Voltage1List = Fulltrim(Arrayunique(v)) Call parent.Save(True,False) continue = True End Sub if your application is to be used through web, you could do it the other way around. you make the responses doc inherit some fields from the parent's doc. in your view you select only the response doc making sure to categorize them by the inherited field and alter the column to display a link to the main doc. This way you can open the main document. I can't imagine a way to have the same behaviour in Notes. XPages maybe.
    435 pointsBadges:
    report
  • Brooklynegg
    Another way to provide parent documents related to child documents that have certain values is to create a folder designed to display the parent documents, then an agent that finds a child documents with the value and puts their parents in the folder. Create a button on the top of the view that runs the agent and let users know that the display is stale until they click the button. Folders hold the documents that are put in them by users or by an agent. You will need to know how the users will use this folder. If more than one user is in the folder and hitting the update button to run the agent, it will be unreliable to the other users accessing the folder at the same time. You might have to use some kind of a private folder to make this reliable for each user, and private folders can be a pain to maintain, etc.
    3,845 pointsBadges:
    report
  • Brooklynegg
    CORRECTION in previous post: Should say "Create a button on the top of the FOLDER that runs the agent ..." Also, Ppolette's post mentions that XPages might do it. I also don't know XPages, so I can't provide any more detail on that.
    3,845 pointsBadges:
    report
  • Gsplmgc
    The view selection should be Votage1 = 6000 - you don't need this field on the parent document. The view properties should have "Show Response documents in a Hierarcy" checked on. You wiil get only parents and responses if Voltage1 = 6000; isn't that what you want?
    70 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following