Solved

The "key" in  Dblookup formula

Posted on 2002-03-25
8
381 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 100 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

Technology Partners: 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!

Question has a verified solution.

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

Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

688 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