Solved

The "key" in  Dblookup formula

Posted on 2002-03-25
8
376 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
  • 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
 

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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

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…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now