Hi a’m a NewBie with the following problemIs it possible to use @DbColumn to open a view with an argument. Depending on a field in a form (username), I want to use @DbColumn to open a view depending on the name the user enters in the form. So it’s not always the user that’s logged in.
Please help. Thanx in advance
Subject: @DbColumn Argument for View
server := some formula to choose a serverdatabase := compute some value here
viewname := compute name based on entered value
col := compute the column number if you wish
@DBColumn ( “”; server : database; viewname; col );
How’s that? You can programmatically determine any of the parameters.
If you need to specify a key, use @DBLookup.
key := optional computed value
@DBLookup …
Subject: RE: @DbColumn Argument for View
As a general rule, if you can specify a quoted string as an argument to an @Function, you can also supply a value that you calculate. This is true of the view name argument to @DbColumn.
Subject: Yes
tmpKey:=NameField;@DbColumn(“”;“”:“INVENTRY.NSF”; tmpKey;2)
Subject: RE: Yes
Can you give me more info.My code is
lutype := “Notes”:“NoCache”;
ludb := “myserver”:“Actplan.nsf”;
luview := “myView”;
lucol := 1;
lookup:=@DbColumn(lutype;ludb;luview;lucol);
Lukey := @Prompt([OkCancelList];“Choose”;“Select”;Null;lookup);
I want to use myView as the view but depending on a field in the form the view has to display different documents.
How can I do this and what do i have to change in the view.???
Subject: @DbColumn and @DbLookup
The view contains the same documents no matter what the values of the field on your form are.
However, you can use field values to select documents from the view using @DbLookup. Arrange for the view’s first sorted column to contain the same values as the field you want to use to control the documents returned.
E.g. if your key value is “x”, make sure that the documents you want to retrieve with your lookup all have “x” in the first sorted column.
If some documents should br retrieved for multiple keys, categorize the view by that that first column and arrange for the column to contain multiple values.
Subject: RE: @DbColumn and @DbLookup
It’s still doesn’t work.My code: I use a button.
@Command([EditDocument];“1”);
lutype := “Notes”:“NoCache”;
ludb := “e/Holding BV”:“Actplan.nsf”;
luview := “AVM”;
lucol := 2;
! Field for search
luSrt = @Name([CN];myName)
lookup:=@DbColumn(lutype;ludb;luview;luSrt;lucol);
Lukey := @Prompt([OkCancelList];“Choose”;“Select”;Null;lookup);
FIELD Actnr:= @DbLookup(lutype;ludb;luview;Lukey;3);
The first column in the view is sorted and containts values like myName (key).
When I push the button I get a window with the first column of the view ??? and not the second.?? What is wrong.
Subject: RE: @DbColumn and @DbLookup
I don’t know. It looks like the @DbColumn should return the second column. Read about @DbColumn in the documentation and make sure you’re counting columns the same way this command counts columns.
For your application, it looks like you should be using @Picklist instead.
Subject: RE: @DbColumn and @DbLookup
Thanx. I use the picklist and my application works.