This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



May 10, 2012, 3:17 AM
32 Posts
topic has been resolvedResolved

Basic @DbLookup question has me stumped

  • Category: Server Side JavaScript
  • Platform: All
  • Release: 8.5.3
  • Role: Developer
  • Tags: @DbLookup,code,query
  • Replies: 3
Hi,
 
I have the following basic @DbLookup that needs to read some values off the person document.  In this instance, I just want the form name to keep it short and simple. 
 
Long term I will be setting some sessionScope variables, based on the login, however short term I just need it to work!  I do not know why it is failing.  Apologies for posting something so basic, but I can't get this to work.
 
I have done a lookup to another database - it works, seems to be the NAB, or a secondary NAB as is the case, where this is not working.  It does not work even if I set a hardcoded value instead of the @UserName() .  I'm stumped?
 
=====================================================================
var db = new Array(@DbName()[0],'names.nsf');
var tmp = @DbLookup(db, "($Users)", @LowerCase(@UserName()), "Form");

if (@IsError(tmp)) {
    return "Grrrr";
} else {
    return tmp;
}
=====================================================================
 
Thanks in advance...
 
Regards,
 
A
May 10, 2012, 4:35 AM
366 Posts
Re: Basic @DbLookup question has me stumped
 Pretty sure this is just a security issue.
 
Make sure that you are authenticating on the server and that the signer of the xpage has access to read the name and address book. 
 
It does not work running locally. 
 
I just copied and pasted you code into a computed field on an xpage on my server and it worked fine. 
 
Paul T. Calhoun 
May 10, 2012, 5:39 AM
32 Posts
Re: Basic @DbLookup question has me stumped
Thanks Paul.
 
Yes, it was permissions, and I do feel daft!  I assumed that the user had read access to the address book configured in directory assistance, when in fact they do not.  It pays to go back to the starting block at times!
 
 
May 10, 2012, 1:35 PM
366 Posts
Re: Basic @DbLookup question has me stumped
 No Worries.  We all have been there before !!!

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal