I have a form with fields:Box - this is text (the name of box)
Colours - and this is the list of choices where many values is possible. Chosen values creates a list of values.
Each box contain few colours. And now I have a view, with columns:
colours: in this column I have each color from colours lists (from my form). And I have rows grouped by colours.
Box: In the second column in group of each color I have boxes wich contain this colour.
for example my form looks:
Box: first
Colour: white, black
Box: second
Colour: green, white
and I have view:
colours: | box:
white:___|
_________| first
_________| second
black:___|
_________| first
green:___|
_________| second
and my question is:
when in view I will click on one row (for example on the “first” box from “white” colour) and I open a form on it, I would like to know row with witch colour was clicked. In my example I clicked on “first” box from “white” color and then the form become open to edit. And now I want to know which color was clicked (in this ex. it is “white”)
I hope that somebody understand me :).
thanks a lot Krzysiek
Subject: Getting the value from views
My understanding of your problem is that you wish to obtain the name of a view category on opening a document from a view.
You can do this by inserting some Lotusscript code into the Queryopendocument event of your view.
Here is a sample:
Dim category As Variant
category = Source.CaretCategory
Messagebox category
Note that Source in the context of the view event is a NotesUIView object.
If you wished to do something with the returned category name on the document being opened, you can obtain the document being opened in the same event with Source.Documents.Getfirstdocument.
Also note that this only works with Notes 5 and above.
Subject: Help me again Please!
Your understanding of my problem is very good. Thank you a lot for it. But I still have a problem. I am new in Lotus. Can you tell me what exactly should I do to have this value (the name of view category) in for example field in my form after opening it. I would like to have a field in it “Category” and it should contain the name of the category which was clicked.
Thank you a lot and I am waiting for response…
Krzysiek
Subject: RE: Help me again Please!
Create your Category field as a text field, make sure it is “Computed for display”. For the compute formula, use the name of the field itself (not enclosed in quotes). The field’s value will not be stored on the document, as it will change depending from where in the view the user opens the document.
Then replace your code in the view’s Queryopendocument event with the following:
Dim uiw As New NotesUIWorkspace
Dim doc As NotesDocument
Set doc = Source.Documents.GetFirstDocument
doc.Category = Source.CaretCategory
continue = False
Call uiw.EditDocument ( False, doc )
You can change the False to True in the EditDocument line to open the document in edit mode.