Field in view get the value from another view

Hi All,

I have created 2 views from different forms. Both views have column of field ‘Name’. For the 1st view, 1 of the column will get the value from 1 of the column in another view, in which field ‘Name’ will behave as a primary key to link between these views.

Anyone can help me on this?

This is urgent! Thanks in advance.

Subject: Field in view get the value from another view

notes 6 doesn’t behave like an RDBMS.You wont be able to use joins.You need to have the field values in the document to diplay it in the view.

Subject: Field in view get the value from another view

When you think of a view, think of it as a “window” to your documents data, showing what you have chosen from the documents. If you want data from view X to show up in view Y, then in view Y you need to reference the documents in view X and the fields you wish to show. Looking at your post, where you mention the column value from another view, think of what this column shows… what field or computation based on data from documents created with what form. Re-create this in the view you wish to show it in. That’s how it’s done in Notes/Domino. Views are not SQL queries or SQL views.

example:

FORM: Product Information

Fields: Product Title. Product Cost. Product Description

View: Products

SELECT form = “Product Information”

rem “This simply selects all documents created with the form Product Information”

Col 1 value

Product Title

Col 2 value

Product Cost

Col 3 value

Product Description

If I want to create another view that references Product Title, I create the with a column referring to Product Title, not the first column of the Product view.

ex

View: Products Less than 20 Bucks

SELECT form = “Product Information” & cost < 20.00

Col 1 value

Product Title

Col 2 value

Product Cost

Notes views do not directly refer to one another to obtain values from their documents the way you do it in an rdb.

Subject: RE: Field in view get the value from another view

Hi Joel Phelan,

What about if i have the following situation:

FORM1: Product Information

Fields: Product Title. Product Cost. Product Description

View1: Products

SELECT form = “Product Information”

rem “This simply selects all documents created with the form Product Information”

Col 1 value

Product Title

Col 2 value

Product Cost

Col 3 value

Product Description

FORM2: Supplier Information

Fields: Product Title. Supplier Name. Supplier Address

View2: Supplier

SELECT form = “Supplier Information”

rem “This simply selects all documents created with the form Supplier Information”

Col 1 value

Product Title

Col 2 value

Supplier Name

Col 3 value

Supplier Address

How about if I want to add new column in view1 to get the information of ‘Supplier Name’ (which is from view2)??

Please advice.

Thank you in advance

Subject: RE: Field in view get the value from another view

Well, what you will run into is a situation where documents (records) exist as individuals in the view. Meaning you could change your selection formula for the first view to this:SELECT form = “Product Information” | form = “Supplier Information”

and add a column

Col 4 value

Supplier Name

but this would show all documents with both forms (try it and you’ll see what I’m talking about. I assume this is not what you want to do.

The only way to get what you want in a notes view is to combine the information into one form. Since you want to get the supplier name from the supplier information form and display it in the view selected by the product information form, look for something you can use that is a “key” on both forms. Then add a computed (or computed when composed if you know the supplier document will exist when you build the product title, and if it will never change (or only be changed by code you write) field. It appears that Supplier Name is on both sets of documents. If this is unique, this could be your key field to do the @dblookup (see the designer help for more on this). If you cannot do a lookup because you do not have unique information to use as a key, you may have to make the field a dialog or combobox field that uses @dbcolumn to fill the list of values.

The short version is that if you want something in a view of documents to display as if it were on that document, then it has to be on that document (or a computation) but it cannot be from another document as this will show a separate document and not achieve the effect you want.

I believe that in Domino 7.x you could do what you want by using the new view elements (Query and Access views) though we’re still on 6.5 here and I have not used them personally. Just thought I would mention it if you want to do research on these.