Just trying to do a “simple” join in a computed column in a view control on an Xpage. I have searched for an example and have not been able to locate one.
What works: Using @Dblookup to another view in the same database.
What does not return data: @DbLookup to same view in another database.
Code that is working:
var key = viewRow.getColumnValue(“Project Code”);
var lookup = @DbLookup(@DbName, “xEventsByProjectCode”, key, 2);
return lookup
Code that is not working:
var key = viewRow.getColumnValue(“Project Code”);
var lookup = @DbLookup(“Intranet\Events.nsf”, “xEventsByProjectCode”, key, 2);
return lookup
Does anyone know
Is this possible?
If possible am I supposed to be specifying the server name? Or is the database sytax incorrect?
Thanks for any help in advance. I apologize if this is trivial knowledge.
It’s possible to lookup from a different database and view as I’ve done it Unfortauntly not many places have posted HOW you actually do it.
The trick is to use an array believe it or not with the server and database.
var db1 = new Array(Server,DatabaseName);
var results = @DbLookup(db1, view,key, colnumber);
Don’t forget to escape the slashes as this is javascript:-
i.e. Server: ‘SERVERNAME/ORG’ or database: ‘folder\databasename.nsf’
Also you mentioned you wanted to do a simple ‘join’. ‘Join’ is a lotusScript function and xpages won’t undertsand this (as far as I know). You’ll actually need to use @implode instead.