Solved

The "key" in  Dblookup formula

Posted on 2002-03-25
8
378 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

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

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

Suggested Solutions

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

822 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