?
Solved

The "key" in  Dblookup formula

Posted on 2002-03-25
8
Medium Priority
?
383 Views
Last Modified: 2013-12-18
Suppose a formula in  button click action as below:
@DbLookup(""; @Subset(@DbName;1):"FORMREF.NSF"; "Data Reference";XYZ; 2));


I find it fail to lookup when the XYZ is a field of names type. Do you all think there are possible to make the dblookup possible to lookup with names field.
0
Comment
Question by:edwardy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
8 Comments
 
LVL 10

Expert Comment

by:zvonko
ID: 6893735
first of all I would extend this code to be error proof:
FIELD XYZ:=XYZ;
FIELDResult:=Result;
@If(XYZ="";@Return("");"");
tmpValue:=@DbLookup(""; @Subset(@DbName;1):"FORMREF.NSF"; "Data Reference";XYZ;2);
@If(@isError(XYZ);@SetField("Result";@Text(XYZ));@SetField("Result";@Implode(XYZ)))


Second; there is a names lookup command: @NameLookup
But what item would you like to lookup in address book person document?



0
 
LVL 10

Expert Comment

by:zvonko
ID: 6893736
Sorry,

this is the proven error proof code :-)
FIELD XYZ:=XYZ;
FIELDResult:=Result;
@If(XYZ="";@Return("");"");
tmpValue:=@DbLookup(""; @Subset(@DbName;1):"FORMREF.NSF"; "Data Reference";XYZ;2);
@If(@IsError(tmpValue);@SetField("Result";@Text(tmpValue));@SetField("Result";@Implode(tmpValue)))

0
 
LVL 10

Expert Comment

by:zvonko
ID: 6893751
Here is the code to lookup email address from server names.nsf:
FIELD XYZ:=XYZ;
FIELD Result:=Result;
@If(XYZ="";@Return("");"");
tmpValue:=@DbLookup(""; @Subset(@DbName;1):"names.NSF"; "$Users";XYZ;9);
@If(@IsError(tmpValue);@SetField("Result";@Text(tmpValue));@SetField("Result";@Implode(tmpValue)))

But easier one would be:
FIELD XYZ:=XYZ;
FIELD Result:=Result;
@If(XYZ="";@Return("");"");
tmpValue:=@NameLookup([Exhaustive];XYZ;"InternetAddress");
@If(@IsError(tmpValue);@SetField("Result";@Text(tmpValue));@SetField("Result";@Implode(tmpValue)))

You see what I mean?


0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:edwardy
ID: 6895392
Thnaks  all your response.

If the field xyz is a filed of Names type e.g a select box with address lookup dialoge box., it make the DBlookup not work. As the KEy should be a text type right?
0
 
LVL 10

Accepted Solution

by:
zvonko earned 400 total points
ID: 6895831
you are not right.

This is EXPERT exchange. So question from expert to expert: how would you test whether this is right or not?

Sometimes I get impression questioner like you sit there and wait as in a quiz show to get the right answer.

How you not switched this dammed checkbox for XYZ on and tested on your own multiple keys? If so, then you would see that both, the @DbLookup and @NameLookup work with XYZ having multiple values. The difference is, that @DbLookup is less failure tolerant: if one key from XYZ is not found, then no value is returned. Multiple keys means of course both: property enabled and multiple keys entered. Without the property are the multiple keys one big value.

Is this ok for you? Or have I miss something in your question?


<|:-)

ps: one sideeffect of @NameLookup is, that all values from ALL directories which mach to search key are returned. All mean: from local names.nsf, home server names.nsf and all sources from DirectoryAssistance (for example: LDAP)
This side effect can make some confision if not taken into account :-)



0
 
LVL 10

Expert Comment

by:zvonko
ID: 7026764
Hello edwardy,

at the moment you have a dozen open question in LotusNotes topic area. Please review then and delete this one in which you are no more interested. Or accept the appropriate comment as an answer.

But please do not let your questions in abandoned state.

Thanks,
zvonko
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 7074342
Finalized by
Moondancer - EE Moderator
0
 
LVL 10

Expert Comment

by:zvonko
ID: 7074918
Thanks Moondancer :-)
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question