Reputation: 1010
I am trying to perform an @DbLookup to another server/database and continually receive an "undefined" return message. The database exists, the view name is correct, the key is correct, as well as the column I am trying to return. I have reader access to the database.
I have tried all these combinations for the server/file path, but none seem to work:
var dbName = new Array(session.getServerName(), "my/folder/thisdb.nsf");
var dbName = session.getServerName() + "!!" + my\\folder\\thisdb.nsf;
var dbName = "CN=Server/OU=Name/O=This" + "!!" + my\\folder\\thisdb.nsf;
var dbName = [@DbName([0]), "my/folder/thisdb.nsf"];
I have found this post and tried most of the combinations:
http://www.c-lutions.com/c-lutions/mcblog.nsf/dx/08242012095124AMJMMJ69.htm
Are there any other combinations I can try?
Thanks!
Upvotes: 0
Views: 1561
Reputation: 380
Make sure the second server is in a trusted server group that is trusted by the first server. For security reasons XPages (and LotusScript) running on any server is unable to access the contents of databases if they are not in the same trusted server group.
Upvotes: 1
Reputation: 20394
Is your folder's name my folder
with a space in it? This could be the challenge. I would suggest to ease your pain....
Create one XPage in your target database, have one computed field on it with @DbName() as formula and see what is coming back. Besides that, your formulas have some issues (comments below the entries):
var dbName = new Array(session.getServerName(), "my/folder/thisdb.nsf");
looks OK unless your folder isn't a subfolder of my. Folders need to be relative to the data directory.
var dbName = session.getServerName() + "!!" + my\\folder\\thisdb.nsf;
dbName must be an array, this one isn't. Also there are no quotes around the file name
var dbName = "CN=Server/OU=Name/O=This" + "!!" + my\\folder\\thisdb.nsf;
same here: must be an array, quote is missing. It is confusing since the data source syntax uses the (CN) format of this: @Name("[CN]";@Subset(@DbName();1)+"!!....
var dbName = [@DbName([0]), "my/folder/thisdb.nsf"];
almost there. @DbName() doesn't take a parameter, so you would write:var dbName = [@DbName()[0], "my/folder/thisdb.nsf"];
or use var dbName = [@Subset(@DbName(),1), "my/folder/thisdb.nsf"];
You also can check great samples to play with.
Upvotes: 3